cout or printf which of the two has a faster execution speed C++?

后端 未结 15 2863
旧时难觅i
旧时难觅i 2020-11-27 07:04

I have been coding in C++ for a long time. I always wondered which has a faster execution speed printf or cout?

Situation: I am designing a

15条回答
  •  悲哀的现实
    2020-11-27 07:28

    You should never need to ask this question, as the user will only be able to read slower than both of them.

    If you need fast execution, don't use either.

    As others have mentioned, use some kind of logging if you need a record of the operations.

提交回复
热议问题