The code below should take the user to the function 'f_main_menu ()' when they enter 'Nick' but instead the program just closes any ideas why?
Code:void f_enter_username () { char Owner[] = "Nick"; char buf[BUFSIZ]; printf ("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEnter username: "); scanf("%s", Owner); fflush(stdout); if (fgets(buf, sizeof(buf), stdin)) { char *p = strchr(buf, '\n'); if (p) *p = '\0'; if (strcmp(Owner, buf) == 0) { f_main_menu (); } else return 0; }



LinkBack URL
About LinkBacks


