multidimensional array - newbie help
I have an array called person (person[10][4]) and I want to allow users to enter person information. The person array is char. I am confused about the scan part and Im not sure how to put the user input into the array to look like
James Bond 13 Smith 11111111
Bunny 17 disney 22222222
for example james bond would have his name in [1][1] address [1][2] phone num [1][3] in the array.
I have gathered that I have to use a for loop
Code:
#include<stdio.h>
#define numRows 10 /* number of rows */
#define numCols 4 /* number of columns */
int main (void)
{
/*declare variables */
int i, j;
char employee[numRows][numCols];
/*Allow a user to enter employee's details*/
printf("Please enter the employee's firstname, lastname, pay classification (in $) and hours worked.");
for (i = 0; i < numRows; ++i)
for (j = 0; i < numCols; ++j)
scanf("%s", &employee[i][j]);
return 0;
}/*end main() function */
Have I done this right? If not what do I have to do to fix it?