循环从键盘输入
- cin.getline()行输入
- 已不同字符结束,或者截断
// xigouhanshu.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <vector>
#include <string>
using namespace std;
int main()
{
const size_t NUM = 100;
char otherthing[NUM]; //此处要求是char 数组,不能是string
/*cin >> anything;
cout << anything;*/
while(cin.getline(otherthing, 100, '\n'))
cout << otherthing << endl;
//while(cin.getline(otherthing, 100, '\0'))
//while(cin.getline(otherthing, 100, '\t'))
//while(cin.getline(otherthing, 100, '0'))
system("pause");
return 0;
}