Hey all, is it possible to use an if statement or strcmp to compare more than one thing?
IE
I want to compare a variable (count) to 5, 10, 15, 20, 25, 30, 35, 40, --> 100
and pause if the variable is equal to any one of them.
something like this
Code:
void displayall()
{
int i;
int count=0;
system("cls");
for (i=0; i<99; i++)
{
if (!strcmp ((entry[i].name), "*"))
{
}
else
{
count++;
cout << (entry[i].name) << "\n" << flush;
cout << (entry[i].street) << "\n" << flush;
cout << (entry[i].streetii) << "\n" << flush;
cout << (entry[i].postcode) << "\n\n" << flush;
if (count==5,10,15,20,25) // <------ can you do something like this?? obviously this wont work but you get the picture.
{
system("pause");
}
}
}
}//end function
or perhaps use strcmp ??? if so how would you format the statement?
any help greatly appreciated. I am using VC++ 6.
thanks
DigiAcid