cout 和 << 运算符在 CYgwin 中编译 c++ 程序时工作正常,但是一旦我尝试使用 cin >> 运算符,编译器就会中断说 cygwin 无法识别 >>?wt是关于什么的?源代码:
#include "TenStrings.h"
#include <iostream>
using namespace std;
using std::cin;
//Default Constructor
TenStrings::TenStrings()
{
int ithElement;
strings[0] = "String 1";
strings[1] = "String 2";
strings[2] = "String 3";
strings[3] = "String 4";
strings[4] = "String 5";
strings[5] = "String 6";
strings[6] = "String 7";
strings[7] = "String 8";
strings[8] = "String 9";
strings[9] = "String 10";
cout << "Enter how many strings you would like to alter: " << endl;
int numAlter;
cin >> numAlter >> endl;
//cin >> "Enter which string to change: " << ithElement << endl;
cout << strings[0] << endl;
cout << strings[3] << endl;
}