Quote Originally Posted by quzah
That's not a solution. That's a problem. fflush is NOT for input streams! Ever. Any attempt to do so is undefined which means anything or nothing can happen. It was never ever intended for input streams.
Sorry, quzah, I am new to this board (I have just subscribed today) and in a rush of giving my contribute I have not yet read the fuc*ed FAQ.
I just thought that Kate was using Microsoft Visual C, where fflush(stdin) is perfectly legal (it is effectively seen as an extension to the C standard). Look at http://msdn.microsoft.com/library/en...crt_fflush.asp for a sample code.
In fact, before answering, I tried my suggestion (with MSVC compiler) and it worked...

Quote Originally Posted by quzah
Then you go on to suggest goto? Why not tell them to use gets while you're at it?
I based my suggestion on the result. The result is the way a program will work; the result is the compiled machine code which will allow the program to run.
Now, please, look at the machine code that the compiler (alas... again the Microsoft one...) will generate for a goto and for a while...

Code:
           while (1) a = 3;
                    mov eax,1
                    test eax,eax
                    je ...  // OUT OF LOOP
                    mov dword ptr [a],3
                    jmp ...  // START OF LOOP
and this is for the goto...
Code:
           retry: a = 3; goto retry;
                     mov dword ptr [a],3
                     jmp retry
The second one seems even more compact than the first one, isn't it?

Best regards, bilbo

P.S. Ah, fortunately "goto" is not in the FAQ! Anyway you must give me credit that I did not discredit the purists!

P.P.S Well, I hope we will become friends, if you leave me the time to make some other contribution, instead of flaming as fast as you can!