c++ how to print string code example Example 1: c++ print string std::cout << ""; Example 2: how to print string data type in c++ printf("%s\n",someString.c_str());