I have an AlphaSeats [60] array and the loop I did, changes the value to 0 and it's suppose to stop when it reaches the index 59 but it goes on and end up changing other variables - PartyName, PartySize and Airplane value to 0 too...
Here is the code. I could not figure out why this is happening...
Anybody who can help me I really appreciate
void main ()
{
char PartyName[20][50];
int PartySize[20];
int Airplane[2];
int AlphaSeats[60];
int CountAlphaSpace(0);
int BravoSeats[60];
int CountBravoSpace(0);
int i(0);
int j(0);
cout << "Please, ente the Party Name: ";
cin >> PartyName[i];
cout << "\n";
cout << "Please, ente the Party Size: ";
cin >> PartySize[i];
cout << "\n";
cout << "Please, choose an Airplane: 1- Alpha or 2- Bravo: ";
cin >> Airplane[i];
for (j = 0; AlphaSeats [j] <= 59; j++)
AlphaSeats[j] = 0;
for (j = 0; BravoSeats [j <= 59]; j++)
BravoSeats[j] = 0;
if (Airplane[j] == 1) //Alpha plane
{
do
{
if (AlphaSeats[j] < 0)
CountAlphaSpace++;
else;
j++;
}while(AlphaSeats[j < 60]);
}
else;
{
do
{
if (BravoSeats[j] < 0)
CountBravoSpace++;
else;
j++;
}while(BravoSeats[j < 60]);
}
}