1
I’m starting to learn C, and I came across the following doubt:
When I ask the user to inform me a song or artist, he ends up informing me a song with spaces, like "AS I AM"
, however the program skips the part of the music and the artist, how to solve this?
printf("MUSICA: ");
scanf("%s", novo->nome);
printf("ARTISTA: ");
scanf("%s", novo->artista);
printf("ANO: ");
scanf("%d", &novo->ano);
typedef struct musica{ char nome[100]; char artista[100]; int ano; struct musica *Prox; }musica;
– Arthur Azevedo
The answer has already solved your problem, I forgot to remove my comment.
– gato