which is faster, and which is more flexible: printf or cout? [duplicate]
问题 Possible Duplicates: printf vs cout in C++ cin or printf?? I've always wondered about printf and cout.. which one is ultimately faster, and is it the most flexible as well (ie can print a range of variables, and output can be formatted)? P.S. I know this looks similar to 'printf' vs. 'cout' in C++ ,but i'm not really asking the same thing. 回答1: Short Answer Faster : printf More flexible : cout Long answer When compared to the sprintf family, the C++ streams are supposed to be slower (by a