"printf" on strings prints gibberish

Viewed 22221

I'm trying to print a string the following way:

int main(){
    string s("bla");
    printf("%s \n", s);
         .......
}

but all I get is this random gibberish.

Can you please explain why?

4 Answers
Related