Hey
Im doing a loop with somthing similar to this:
char stn[25];
do
{
printf ("Insert a number:\n");
gets(stn);
}while (stn!="123");
if (str=="123")
{
printf ("Good value!");
}
Now if I input 123, it enters the if that prints "Good value!" and the program ends naturally.
Now if I input 32432, 23432, 23234, 1233,9898, 87343, 238432 (all of this it would continue inside the do while loop) and finally I enter 123, it prints "Good value!" but the program itself crashes.
Very strange. I think it is a error with the buffer overfilling or something similar. I tried with fflush(stdin) before/after/both in the gets() loop but nothing.
How can I solve this?