Code:
int main (int argc, char* argv[]) {
char license_plates[M][N];
double pay[M];
int i, j;
for (i = 0; (i < M); i++) {
pay[i] = -1;
for (j = 1; (j < N); j++) {
license_plates[i][j] = '-';
}
license_plates[i][0] = '\0';
}
return 0;
}
Whenever I run the gdb debugger on this, it turns out that the license_plates array is only filled with '-' when what I'm clearly trying to have is a '\0' in license_plates[i][0] and a '-' on the rest of each row. Why is this happening?
I have defined M as 5, N as 11, and have included <stdio.h>.
The license_plates array is supposed to include strings which are given later on. Is there a better way to initialize an array of strings?