That is the code:
int qtd_alunos, qtd_temas;
char* tnome[1][10];
char* anome[1][10];
printf("\nPra distribuir os temas me diga quantos alunos vao participar e aperte enter, depois a quantidade de temas.");
scanf("%d%d", &qtd_alunos, &qtd_temas);
printf("Agora vai escrevendo o nome de cada tema\n");
for(int j = 0; j<qtd_temas; j++){
printf("Tema %d\n", j+1);
scanf("%s", tnome[0][j]);
printf("%s ok!\n",tnome[0][j]); }
return 0; }
When I run the code the program saves just the position "tnome[0][0]"
, but when the "int j"
changes to [0][1]
the program closes. I neeed to understand why it happens.