#include<iostream>
using namespace std;
int main() {
const char* str = "Hello World \n yes you\0 hia";
//到\0处截止计算
int len = strlen(str);
for (int i = 0; i < len; i++) {
//遇到\n换行符号不会停止,而是读取到指定数目字符或遇到\0停止
//传入地址,输出i个字符
cout.write(str, i);
cout << endl;
}
return 0;
}
cout.write的学习
最新推荐文章于 2023-12-10 20:57:40 发布