Of course you still have to declare the size of the array.
Printable View
Of course you still have to declare the size of the array.
LOL. This is lot harder then I thought. One problem after the other.
changing my code to this
does not allow me to input anything. So when i run i get this:Code:printf("Enter 'book' or 'cd' for type: ");
fgets(type,5,stdin);
printf("Enter name of author/artist: ");
fgets(name,50,stdin);
printf("Enter title: ");
fgets(title,50,stdin);
Code:Enter 'book' or 'cd' for type: Enter name of author/artist:
So: mixing scanf and fgets is always ... interesting. scanf leaves the enter-key behind (remember that it stops on whitespace) which means that the first fgets after a scanf doesn't see any input. If you search here you'll see several suggestions for dealing with that. (You can change all your scanf's into fgets, but that gets rather annoying for ints; or you can do an extra read.)
:confused:
whats an extra read?
OMG WONDERFUL!!!!! IT WORKS!!!
*HUGS* (in a non weird kind of way)
Thanks a million man!!!
special thanks to tabstop and nonoob. You can archive this forum no mr. moderator. Thanks again. I go now and eat (haven't ate all since lunch). Good night.
And once again THANK YOU!!!!