how to print string in c++ code example
Example 1: how to print in c++
int main() {
std::cout << "Hello, World!"; // prints 'Hello, World!' to the output.
return 0;
}
Example 2: how to print in c++
using namespace std;
int main(){
cout<<"Hello World!"<< endl; // prints "Hello World"
return 0;
}
Example 3: print in cpp
using namespace std;
int main() {
cout << "Hello World!";
return 0;
}
Example 4: c++ print string
std::cout << "";
Example 5: print in c++
using namespace std;
int main() {
cout << "ENTER TEXT HERE";
return 0;
}
Example 6: how to print string data type in c++
printf("%s\n",someString.c_str());