'printf' vs. 'cout' in C++

后端 未结 16 1782
梦如初夏
梦如初夏 2020-11-22 07:04

What is the difference between printf() and cout in C++?

16条回答
  •  借酒劲吻你
    2020-11-22 07:23

    cout<< "Hello";
    printf("%s", "Hello"); 
    

    Both are used to print values. They have completely different syntax. C++ has both, C only has printf.

提交回复
热议问题