Click here to Skip to main content
15,921,793 members

Comments by Topuchi13 (Top 3 by date)

Topuchi13 13-Feb-13 11:00am View    
what about using fgets() instead of scanf and than manually add null terminator to the string with some nice loops??
Topuchi13 13-Feb-13 10:42am View    
thanks for this informative and helpful answer. I call main() to go back to main menu of program,(in idea at least :)) and remouving it doesn't solve my problem. i guess that my problem is in text i/o functions, but I couldn't understand how to solve it.
P.S I promise :):):).
Topuchi13 13-Feb-13 10:00am View    
main just calls this and some other functions, here it is
int main ()
{
system ("cls");
printf ("********************************************\n");
printf ("****This is your personal diary software****\n");
printf ("********************************************\n\n");

printf ("Please chose your desired action(input a corresponding number): \n\n");
printf ("1. Make a new record\n");
printf ("2. View a record\n");
printf ("3. Edit a record\n");
printf ("4. Delete a record\n");
printf ("5. Take a break and play some tic-tac-toe ;)\n");
printf ("6. Change your p.diary password\n");
printf ("7. Leave your p.diary\n\n");
int a;
scanf ("%d", &a);

switch (a)
{
case 1:
makerec();
break;
case 2:
viewrec();
case 3:
editrec();
break;
case 4:
deleterec();
break;
case 5:
tictactoe();
break;
case 6:
editpassword();
break;
case 7:
printf ("Thank you for using this software\n");
exit(0);
default:
printf ("You entered a wrong number, Try again");
break;
}
return 0;
}