Hi, total fresh n00b to c++ here. I'm trying to solve a problem to handle ticket sales for a show. To represent the seats at the show, I made a 2D array, named chart, of structures, named "seat", which contain a string of characters for the customer name, a string of characters for the type of seat, and a boolean for whether or not the seat is available. Right now I'm trying to initialize this array. But I'm coming across a couple of difficulties.
I did the following:
int row;
int col;
for (row=0; row<15; row++){
for (col=0; col<25; col++){
strcpy(chart[row][col].customer,"blank");
strcpy(chart[row][col].type,"nul");
}
}
However, when I ask for the program to print the names of each seat in the theatre (chart[][].customer), I get a bunch of nul's instead. So I'm assuming what I did in the second line within the nested for loop overwrites what I did in the first line. Where am I messing up here and how can I fix it?