请问能不能既用class又用printf和scanf,会显得语言风格很混乱吗 #16
-
|
如上 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
|
众所周知 g++ msvc clang 都支持printf。 因此,不是问题。 |
Beta Was this translation helpful? Give feedback.
-
|
事实上, |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
printf的格式化输出还是很好用的,怎么方便怎么来,C++是C的超集,不能有了OO思想就忘了亲爹 |
Beta Was this translation helpful? Give feedback.
事实上,
printf依然存在在很多的C++项目中,Is it a bad practice to use printf in C++? 也许是你想问的,据我所知,JVM中存在大量的printf,还是一样的道理,C++会向下兼容很多的东西,虽然不能说C++是C的超集,但是确实很多东西C++都会保持兼容,如果你认为一些风格混乱,我认为这样的情况存在一定的风格混乱,比如你用了C++的using关键字,然后你还用在C语言中经常出现的typedef。