How to declare string in C++?

0 votes
asked Aug 28, 2014 by asfg

  How to declare string in C++?

Give some sample for declare variable?

1 Answer

0 votes
answered Aug 28, 2014 by kalpana (3,995 points)
include <string>

using namespace std;

int main()
    string str1("argue2000"); //define a string and Initialize str1 with "argue2000"    
    string str2 = "argue2000"; // define a string and assign str2 with "argue2000"
    string str3;  //just declare a string, it has no value
    return 1;