A string is basically an array of characters. In C++ anything written within a double quotes is a string.
Consider the first hello world program
char greeting[13] = "hello world";
char greeting[] = "what";// YOU NEED NOT PLACE THE '\0' CHARACTER
"\0" is used automatically added at the end of a string.
#include using namespace std; int main () { char greeting[5] = "hello nice to meet you"; cout << "Question: "; cout << greeting << endl; return 0; }
Output: Question: hello nice to meet you