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

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

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

16条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 07:35

    And I quote:

    In high level terms, the main differences are type safety (cstdio doesn't have it), performance (most iostreams implementations are slower than the cstdio ones) and extensibility (iostreams allows custom output targets and seamless output of user defined types).

提交回复
热议问题