void cadastroturma () {
char turma[30],caminho[100];
printf ("Diga o nome da turma a ser cadastrado:\n");
scanf ("%[^\n]", &turma);//Já tentei com gets e fgets
getchar();//Já tentei sem esse getchar
printf ("\nAgora o caminho onde quer gravar a turma:\n");
scanf ("%[^\n]", &caminho);
getchar();
mkdir(caminho);
strcat(strcat(strcat(caminho,"/"),turma),".coe");
printf("%s", caminho);
FILE *cadastro = fopen (caminho, "ab");
Hello, I am doing a job in the faculty of archiving, this is the function of class registration, I have not yet put the number of students but this is not the point ... The problem is that in the output, in so many ways that I have already put it, the file created inside the folder either goes unnamed before the extension or is not created in any way. I've even tried it with the infamous gets () function and it did not work. What I want to do is enter the class name, then the folder name, create the folder and then join the names to create the file inside the folder. Can anyone help me?