0
cout和< <運算符在編譯CYgwin中的C++程序時工作正常,但只要我嘗試cin >>運算符,編譯器中斷說cygwin不會識別>>?重量是約? 源代碼:cygwin不承認>>運營商? C++
#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;
}
我們可以看到導致問題的源代碼嗎?有可能還有其他事情正在進行,這將有助於確切瞭解您如何使用操作員。 – 2011-02-07 23:35:12
您能否提供錯誤消息的確切文本和一些導致它的示例代碼。說真的,在文本框中有足夠的空間,你不會用完字母。 – 2011-02-07 23:35:18