can someone tell me how i can transfer
scanf("%s",input->album);
to a gets (); function.
thx
can someone tell me how i can transfer
scanf("%s",input->album);
to a gets (); function.
thx
i cant use scanf as i want to keep spaces
however when i try fgets it dont let me enter anything
i know scanf works which is why i wanted a gets version
VVV can you help
case 1: /*Reading in data*/
printf("\nEnter the artist: ");
//fgets((input)->artist);
fgets( ( *input ).artist, 48, stdin ); ( *input ).artist[strlen( ( *input ).artist ) - 1] = 0;
printf("%s", (*input).artist);
//puts((*input).artist );
fgets( buffer, 20, stdin );
ok like this it works
but the string is lost
like this
case 1: /*Reading in data*/
printf("\nEnter the artist: ");
//fgets((input)->artist);
fgets( ( *input ).artist, 48, stdin ); ( *input ).artist[strlen( ( *input ).artist ) - 1] = 0;
printf("%s", (*input).artist);
//puts((*input).artist );
//fgets( buffer, 20, stdin ); <----note
Enter the artist: Enter the album:
thus stopping me from entering artist
moved buffer and it worked
thx VVV my program is all down to you as you know