摘要: 首先,istrstream类的两个构造函数: istrstream::istrstream(const char* str); istrstream::istrstream(const char* str, int size);接着,看下面一段代码: 1 #include 2 #include 3 4 void main() 5 { 6 char str[100]="I am a student.\n"; 7 char a; 8 istrstream ai(str, 5); 9 10 ai>>a;11 cout>a)的重复次数: n=1, ... 阅读全文
posted @ 2013-08-30 22:01 bees 阅读(708) 评论(0) 推荐(0) 编辑
摘要: 首次,定义三个字符数组;char a[20];char b[20];char c[20];其次,建立一个文件——"Test 2.txt";其中的字符内容:ffffff,ssssssssss;ggggggg,eeeeeee(ps:就一行)再次,对输入进行文件类定向;ifstream fin("Test 2.txt");最后,进行对比研究;表格 1代码A:fin.get(a, 20, ',');cout<<a<<endl;fin.get(a, 20, ','); cout<<a<< 阅读全文
posted @ 2013-08-30 21:06 bees 阅读(451) 评论(0) 推荐(0) 编辑