Hi fellows i am making this program for a class of mine and i am trying to capture a bar code of 8 digits i am not sure wether i should should define the variable with char or with int anyhow my problem is that it would always tell me that my condition is wrong here is the part of my code that is not working and also the structure.
void main ()
system ("cls");
cout<<"\t\t Add bar code"<<endl<<endl;
cout<<endl<<"Itroduce bar code of "<<videogame[i].name<<endl;
cout<<"\tBar could should only contain 8 digits"<<endl;
cin>>videogame[i].bar;
if (videogame[i].bar<=00000000 || videogame[i].price>99999999)
system ("cls");
cout<<"ERROR\n Bar code should contain 8 digits, try again"<<endl;
cout<<videogame[i].bar;
system ("PAUSE");
i know i must be wrong with the if statement is just that i already tried so many ways like searching for null or \0 in the last place of the structure variable that i tought this could be the easiest way any hints or help will be very welcome.
Assuming you can give a struct alias name like that
How do i make my code work?? it should be able to accept 8 digits no more no less not char nor anything should i use scanf ?? help please