I\'m trying to print a string the following way:
int main(){ string s(\"bla\"); printf(\"%s \\n\", s); ....... }
but all I
Because %s indicates a char*, not a std::string. Use s.c_str() or better still use, iostreams:
%s
char*
std::string
s.c_str()
#include #include using namespace std; int main() { string s("bla"); std::cout << s << "\n"; }