I was just asking, is it also possible to define 2D arrays? If so, how do I pass them into the functions and use them in an address book? As in can I say employee.name[x][] when I use things like strcmp, puts, or gets, or must i say employee.name[x]?

>is it also possible to define 2D arrays?
Yes.

>how do I pass them into the functions
Just like passing any other type, you match the declaration:

void foo ( int a[2][5] );

int main()
{
  int a[2][5];

  foo ( a );
}

There are variations, of course, but this is by far the easiest guideline to remember.

>As in can I say employee.name[x][] when I use things
>like strcmp, puts, or gets, or must i say employee.name[x]?
Ultimately, you must pass the correct type. If you have an array defined like so:

char a[10][20];

You still need to pass a pointer to char to puts (for example):

puts ( a[x] );

A 2D array is nothing more than an array of arrays. Keep that in mind when working with them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.