Standard library header files in C++

Hello everyone we have seen Hello world program in C++

headerfiles

The first line of the program Hello World we can see its written #include.What is actually, well writing C/C++ program we need to write this.This is header file in C++.

In the C++ programming language, the C++ Standard Library is a collection of classes and functions, which are written in the core language and part of the C++ ISO Standard itself. The C++ Standard Library provides several generic containers, functions to utilize and manipulate these containers, function objects, generic strings and streams (including interactive and file I/O), support for some language features, and functions for everyday tasks such as finding the square root of a number. The C++ Standard Library also incorporates 18 headers of the ISO C90 C standard library ending with “.h”, but their use is deprecated. No other headers in the C++ Standard Library end in “.h”. Features of the C++ Standard Library are declared within the std namespace.

The C++ Standard Library is based upon conventions introduced by the Standard Template Library (STL), and has been influenced by research in generic programming and developers of the STL such as Alexander Stepanov and Meng Lee. Although the C++ Standard Library and the STL share many features, neither is a strict superset of the other.

A noteworthy feature of the C++ Standard Library is that it not only specifies the syntax and semantics of generic algorithms, but also places requirements on their performance.These performance requirements often correspond to a well-known algorithm, which is expected but not required to be used. In most cases this requires linear time O(n) or linearithmic time O(n log n), but in some cases higher bounds are allowed, such as quasilinear time O(n log2 n) for stable sort (to allow in-place merge sort). Previously sorting was only required to take O(n log n) on average, allowing the use of quicksort, which is fast in practice but has poor worst-case performance, but introsort was introduced to allow both fast average performance and optimal worst-case complexity, and as of C++11, sorting is guaranteed to be at worst linearithmic. In other cases requirements remain laxer, such as selection, which is only required to be linear on average (as in quickselect), not requiring worst-case linear as in introselect.

The C++ Standard Library underwent ISO standardization as part of the C++ ISO Standardization effort, and is undergoing further work regarding standardization of expanded functionality.

Download Standard C++ Library Reference from EBOOKS

Advertisements

Namepaces in C++

You all have seen in previous post (Helloworld program) we have used something called as namespace . What it is actually? What its use?

Namespaces provide a method for preventing name conflicts in large projects.

Symbols declared inside a namespace block are placed in a named scope that prevents them from being mistaken for identically-named symbols in other scopes.

Multiple namespace blocks with the same name are allowed. All declarations within those blocks are declared in the named scope.

 using namepace std;

It includes all C++ standard Libraries.

EXAMPLE:-

 

Hello World!!

Let’s make a Hello World Program in C++.

Open a Text Editor.(Sublime Text)

AND JUST FOLLOW THE STEPS:-

OPEN SUBLIME-

Code:-
#include<iostream>
using namespace std;
int main(){
cout<<“Hello World!!!”;
return 0;
}

COMPLING IN SUBLIME:-
Goto tools>build with>C++ single file run


Yup!!
You are Done

Let’s Start

For learning coding you need a system(desktop/laptop) with a good internet connection.Well internet is required because their are lot of websites with tutorials available which will help you.First thing you need is mindset yup!!! mindset it is important for anything you want to learn and remember one thing especially in this case “GIVING UP IS NOT AN OPTION” just try try and try thats how you learn.

For C++ programming all you need is a text editor(I use Sublime Text editor) and you are done.Well I recommend you all to use Sublime Text Editor.

download Sublime text editor-https://www.sublimetext.com/3

INSTALLING SUBLIME:-

ALMOST DONE!!!!