【发布时间】:2016-10-11 18:20:08
【问题描述】:
我正在编写一个程序,除了下面的函数外,一切正常。我很好奇什么是最好的,这样第一个循环的用户输入只能是 1 - 69,而第二个循环只能是 1 - 26。
我打算执行一个 do/while 循环,但出现如下错误。
//***********************************************
//Case 4 lets you input your own lottery numbers*
//***********************************************
void case4()
{
cout << numberprint << endl;
tickettop();
int array_pick[4];
int pballp;
for (int i = 0; i < 5; i++)
{
cout << evalue << i + 1 << space1;
do
{
cin >> array_pick[i];
} while (array_pick > 0 && array_pick <= 69); //Here is where I get an error for array_pick <= 69 (operand types are incompatible ( int * and int))
}
for (int i = 0; i < 1; i++)
{
cout << eball;
cin >> pballp;
}
cout << endl << endl;
ofs << endl;
ticketbottom();
ofs << bar << box << bar << endl;
}
【问题讨论】:
-
while (!(array_pick > 0 && array_pick <= 69));,我没有看到你的第二次尝试。