Difference between fgets and gets
问题 What is the difference between fgets() and gets() ? I am trying break my loop when the user hits just "enter". It's working well with gets() , but I don't want to use gets() . I tried with fgets() and scanf() but I don't have the same results as with gets() . fgets() breaks the loop whatever user enters in text! Here is my code : void enter(void) { int i, for(i=top; i<MAX; i++) { printf(".> Enter name (ENTER to quit): "); gets(cat[i].name); if(!*cat[i].name) break; printf(".> Enter Last Name: