How can i add strings to an array like this ? I have a string called "line" which reads users's input and then stores it in "var" . Var is sized [10][40] so it can store 10 strings with the size of 40 each of them (hope that this is what it does ? ) .
int main (int argc, char **argv){
int i=0,n=0;
char line[40];
char var[10][40];
while(n<10){
gets(line);
strcpy(var[i],line);
printf("%s",var[i]);
i++;
n++;
}
}