“printf” on strings prints gibberish

前端 未结 4 1880
执笔经年
执笔经年 2020-12-06 17:05

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

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

but all I

4条回答
  •  执笔经年
    2020-12-06 17:30

    I've managed to print the string using "cout" when I switched from :

    #include 
    

    to

    #include 
    

    I wish I would understand why it matters...

提交回复
热议问题