I have edited my code so that you can understand how to declare a function prototype containing 2D array as parameter. Also use fgets() instead of gets(). The function returns the number of marks read , i.e. an integer. I think this might help. Run the code and look on the man pages or google to understand fgets() better.
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define SIZE 1000
int stringcopy(char m[][SIZE],char temp[]);
main()
{
char temp[SIZE],m[100][SIZE];
fgets(temp,SIZE,stdin);
int num=stringcopy(m,temp);
int i;
for(i=0;i<num;++i)
printf("%s\n",m[i]);
return 0;
}
int stringcopy(char m[][SIZE],char temp[]) {
int len=strlen(temp);
int i,j=0,k=0;
for(i=0;i<len;++i) {
if(temp[i]!=',')
m[j][k++]=temp[i];
else {
m[j][k]='\0';
++j;
k=0;
}
}
m[j][k-1]='\0';
return j+1;
}