How do I read a string with a compound name for example: "Vitor Martins"? I'm doing this program that stores a student's name and grade, but it gives a bug when entering two names.
#include<stdio.h>
#include<string.h>
#define alunos 3
int main(){
int x;
float nota[alunos];
char nome[15];
for(x=0; x<alunos; x++){
printf("Digite o nome do %d(o) aluno: ", x+1);
scanf("%s", nome);
printf("Digite a nota do aluno %s: ", nome);
scanf("%f", ¬a[x]);
printf("\n");
}
}