w******g 发帖数: 67 | 1 We know "printf" and "system" are "C" functions. Although we can use them in
C++, I wonder
1.For formatting the output and string, are there similar functions like "
printf" and "sprintf" in C++?
2.For running external program in C++, are there similar functions like "
system" and "popen" in C++? | w***g 发帖数: 5958 | 2 sprintf和system也是标准的C++函数,只不过要用和.虽然他们不是
面向对象的,但是他们和cin, cout一样写在了C++标准中。boost::format是sprintf的
一个比较好的替代品。
in
【在 w******g 的大作中提到】 : We know "printf" and "system" are "C" functions. Although we can use them in : C++, I wonder : 1.For formatting the output and string, are there similar functions like " : printf" and "sprintf" in C++? : 2.For running external program in C++, are there similar functions like " : system" and "popen" in C++?
| c*******g 发帖数: 771 | |
|