C++ String


Go to main Page

String in C++

A String variable is a collection of characters that are surrounded by double-quotes.

Strings are used to store text and collection of Characters.

string name="shameer";

Example

#include <iostream>
    using namespace std;
    int main()
    {
        string name="shameer";
        string address="pakistan";
        cout<<"Your name is " << name <<"Your address is << address";

    }

Output

Your name is shameer your address is Pakistan.