Ok am new to programming so go easy on me. I want to make a program that allows a user to input a name, marital status, sex and residence of 30 students. Here's my code and the only problem is the program is allowing inputs above the expected 120 inputs.
#include <stdio.h>
char std[30][40];
int x,y;
main()
{
printf("Enter number of students: \n");
for(x=o;x<30;x++x=0;x<30;x++)
for(y=0;y<4;y++)
scanf("%s" &std[x][y],);
return 0;
}
I'm wondering: can I use pointers to access multidimensional array elements?