Using a string in printf()

Just wondering how exactly you display a string with printf(). As when ever I try displaying one of the strings I create with printf() like this printf("%s", myString); It will say null when it displays in the console. But lets say I'm displaying the same myString using std::cout instead. It will display whats inside the string.

So basically just wondering if I'm using printf() wrong?
1
2
// try:
printf( "%s", myString.c_str() );
Omg how did I forget that. I'll go boot vs up now and see how she goes! Thanks

EDIT:
Needless to say it worked and I feel like a total retard for forgetting that haha.

Thanks seymore!
Last edited on
Topic archived. No new replies allowed.