Functions, twoDarrays and char's

void loadSeats(char [][30])
{

const int ARRAYROWS = 15;
const int ARRAYCOLUM = 30;
char twoDArray [ARRAYROWS][ARRAYCOLUM];



fstream seatingFile;
seatingFile.open("seatingChart.dat");

if (!seatingFile)
{
cout << "File not found" << endl;
cout << "Entering default seating chart" << endl;
for(int rowNumber = 0; rowNumber < ARRAYROWS ; rowNumber++)
for(int columnNumber = 0; columnNumber < ARRAYROWS ; columnNumber++)
{
twoDArray[rowNumber][columnNumber] = "#";
}
}
else
{
for(int rowNumber = 0; rowNumber < ARRAYROWS ; rowNumber++)
for(int columnNumber = 0; columnNumber < ARRAYROWS ; columnNumber++)
{
seatingFile >> twoDArray[rowNumber][columnNumber];
}
}


}

It says i cannot change a constant value.

The problem for the project is that we have a theatre seating chart project and each ticket already sold is "*" symbol or available ticket it "#" symbol.

Now, if i am loading seatingFile and I do not find the file, that means the program is used for the first time, and i have to create the file with all "#" values.

But i am getting an error, how do i fix it, thanks
the only error i got when running your code is in the line
twoDArray[rowNumber][columnNumber] = "#";
change the "#" to '#' and it works fine for me.
thanks bud
Topic archived. No new replies allowed.