Monday, 6 January 2014

Filled Under:

String in c++:

String in c++:

Library :

  “ #include<string>”

Explanation:


                      Collection of character is called string.  Char data type only store the single character .for storing the collection of data c++ provide a data type as string  in which we can store the collection of character. For use this data type c++ provide a library “#include<string>”  this is not fundamental library. But it behave like fundamental type. By using this library we use many string functions like string comparison etc we will discuss it later in our lesson.

Example:

#include<iostream>
#include<string>
Using namespace std;
     main()
{
String new;        //declaration of new variable whose data type is string
    new=”this is programming logic .net site”    // initialization of variable

…………………….
…………………….
…………….
}




0 comments:

Post a Comment