here is my problem! i'm trying to intput a string using fget() method. The problem is it doesn't allow me to do it. Here is what i did:
i was able to input the course number and print it out, but after i hit enter, it skip the fget() and never give me a chance to input a string, and it end up "Press any key to continue". I have checked exactly what to do when using fget() method to input a string, and i did the same as tutorial in this website.Code:#include <stdio.h>
int main()
{
int coursenumber;
char coursetitle[50];
printf("Enter Your Course Number:\n");
scanf("%i", &coursenumber);
printf("%i\n", coursenumber);
printf("Enter Your Course Titlte:\n");
fgets(coursetitle, 50, stdin);
printf("%s", coursetitle);
system("PAUSE");
return 0;
}