Representing Strings in Code Using Literals - C++ Data Type

C++ examples for Data Type:string

Description

Representing Strings in Code Using Literals

Demo Code

#include <iostream>
#include <string>

using namespace std;

namespace//from   w w  w  . j av  a  2s. c o m
{
    const std::string STRING{ "This is a string"s };
}

int main()
{
    cout << STRING << endl;

    return 0;
}

Result


Related Tutorials