1 //ostream类 2 //put成员函数的功能是把一个字符插入到输入流中 3 //write成员函数是从字符串数组中提取若干个字符插入到输出流中 4 #include<iostream.h> 5 int main(){ 6 7 char ch1[]="i="; 8 char ch2[]="x="; 9 10 int i=100; 11 float x=11.11; 12 13 cout<<ch1<<i<<endl; 14 cout<<ch2<<x<<endl; 15 16 char ch3[]="abcdefg"; 17 cout.write(ch3,5)<<endl; 18 19 return 0; 20 }
原文:https://www.cnblogs.com/Tobi/p/9250819.html