For instance, there are 3x10 seats, with the rows numbered 1 - 10 and the columns labeled A, B, C. How should I declare such an array?
For instance, there are 3x10 seats, with the rows numbered 1 - 10 and the columns labeled A, B, C. How should I declare such an array?
You can't but you have several other ways to represent that data.
One would be to have a structure called data that has three 1D arrays called A, B and C.
Another one would be to use some enum to call the columns 0,1,2 or A, B, C alternatively.
1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.
Got it, thanks.![]()