compiling error please help

//it does not even give me an error to fix please help

#include <iostream>
#include <ctime>
#include <cstdlib>
#include <iomanip>

using namespace std;

int main()

int lottery [4], user [4];
int count=0;

for (int i=0; i<4; i++)

lottery [i]= 1 + rand () %9;

cout << "Enter four numbes: \n";

for(int i=0; i<4; i++)

cin >> user [i];

cout << " ThE luCkY NuMbErS ArE: \n";

for (int i=0; i<4; i++)


if( lottery [i]==user[i])


cout << lottery [i] << " ";

count ++;



if (count==4)

cout << " Winner!!!! of the $10000 TaX FrEe.";

cin.ignore (1000, '\n');

return 0;

Last edited on
for (int i=0; i,4; i++)
See something wrong here?


Also, with that error being corrected, it seems your program simply stops if you don't guess the correct numbers?

It tells me "ThE luCkY NuMbErS ArE: " immediately after entering 4 numbers, and not going any farther. Perhaps it is comparing it to the 'winning' numbers, and since I'm not correctly guessing, there is no /else/, or /else if/ to fall back on.

Consider revising code?
thank you guys but i won't be able to work on it until monday when i have class my computer doesnt run visual its a mac and i got the parallels i just cant get it to run :( but thanks again it looks like there are a few things to change
What's wrong with installing XCode? XCode's clang-ripoff should be able to compile that just fine.

Topic archived. No new replies allowed.