C++: Print a string using printf (stdio.h)


In order to print a string in C++ using the printf from the stdio.h library use it as follows:

string Phrase = "Hello!!";
printf("Phrase: %s\n",phrase.c_str());

 

This post is also available in: Greek

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.