Help I am having the following error:
error C2446: '==' : no conversion from 'int' to 'char *'
When I tried the following it ignores my counter and I am not sure why. This is a serious problem because it creates and infinite loop that keeps printing.
if(char(seating[openSeat + potential]) == '#')
counter2++;
My code is the following:
void Tickets::displayOptions()
{
cout << "The following blocks are available: " << endl;
for(int openRow = 1; openRow < row; openRow++)
{
cout << "row " << openRow << ": ";
for(int openSeat = 1; openSeat < seat; openSeat++)
{
int neededSeatsOpen = (seat-1) - (openSeat - 1);
if(neededSeatsOpen >= qty)
{
int counter2 = 0;
for(int potential = qty - 1; potential >= 0; potential--)
{
if(char(seating[openSeat + potential]) == '#')
{
counter2++;
}
}
if(counter2 = qty)
{
for(int available = 0; available <= qty - 1; available++)
{
cout << seating[openSeat + available] << " ";
}
}
} // end if
} // nested end for
}// end for
} // end function display Options