C++输出字符串的多种方法:除了cout<<,还有printf!
在C++中,除了使用'cout<<'来输出字符串外,还可以使用'printf'函数来输出字符串。示例如下:
#include <cstdio>
int main() {
const char* str = 'Hello, World!';
printf('%s
', str);
return 0;
}
原文地址: https://www.cveoy.top/t/topic/pPFV 著作权归作者所有。请勿转载和采集!