2D Arrays C

1
2
3
4
5
6
7
8
typedef struct Emp 
{
    unsigned char lastname[61]; 
    unsigned char firstname[61];
    unsigned int  id;
    unsigned char dept;
    bool          married;
    } Emp;


I have a stupid question...The struct above is not a 2D array? Right?
No. A 2D array is one you index like
foo[ 2 ][ 7 ]

You can declare one as:
 
int a[ 20 ][ 10 ];  // a is a 2D array: 20 rows by 10 columns 


Hope this helps.
@Duoas,

I knew it was a stupid question, but thanks for easing me.

Topic archived. No new replies allowed.