tstio.cpp
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C++ 代码 · 共 54 行
CPP
54 行
#include <fstream.h>
#include <strstrea.h>
#include <stdlib.h>
#include "perlclas.h"
#include "perlasso.h"
void main()
{
ifstream fin("t.in");
ofstream fout("t2.txt");
PerlString s;
PerlStringList l;
while(fin >> s){
cout << "read in string: " << s << endl;
fout << s << endl;
}
#if __WATCOMC__ < 1000
fin.clear();
#endif
fin.close();
fout.close();
fin.open("t.in");
fin >> l;
cout << "List =" << endl << l << endl;
#if 1
strstream ss, iss;
ss << "one\n" << "two\nthree\nfour\n";
ss >> l;
cout << l << endl;
PerlList<int> il;
iss << 1 << " " << 2 << " " << 3 << " " << 4 << endl;
iss << "5 6 7 8 9" << endl;
((istream&)(iss)) >> il;
cout << il << endl;
#endif
cout << "Start Typing:" << endl;
while(cin >> s){
cout << "read in string: " << s << endl;
}
exit(0);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?