Using the string Type to Create a String Variable - C++ Data Type

C++ examples for Data Type:string

Description

Using the string Type to Create a String Variable

Demo Code

#include <iostream>
#include <string>
using namespace std;

int main()// w  w w  .  j  a v a  2  s  .c o m
{
  string mystring;
  mystring = "Hello there";
  cout << mystring << endl;
  return 0;
}

Result


Related Tutorials