源程序:
//程序7-10
#include <iostream>
using namespace std;
int main()
{
char c = 'a', str[80] = "0123456789abcdefghijklmn";
int x = 65;
cout << "cout.put('a'):";
cout.put('a');
cout << " cout.put(c+25):";
cout.put(c + 25);
cout << " cout.put(x):";
cout.put(x);
cout.write(str, 20); //将str的前20个字节写入到输出流中
system("pause");
return 0;
}
运行结果: