📄 12.20.cpp
字号:
#include <iostream.h>
#include <fstream.h>
#include <strstrea.h>
void main()
{
char buf[80];
ostrstream out1(buf,sizeof(buf));
int a=10;
for(int i=0;i<5;i++)
out1<<"a="<<(a+=5)<<';';
out1<<'\0';
cout<<"buf: "<<buf<<endl;
double b=12.345678;
out1.setf(ios::fixed|ios::showpoint);
out1.seekp(0);
out1<<"The value of b is "<<b<<'\0';
cout<<"buf: "<<buf<<endl;
char *pstr=out1.str();
cout<<pstr<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -