i broke while
In which way does it freeze? The example you gave is an infinite loop, so it will never end and therefore appear to be frozen.
Or does it simply not print out any "this" at all?
Or does it simply not print out any "this" at all?
I've had weird things like that happen to me too when using Visual Studio 6. The common fix seems to be just create a new workspace and file and what not, and just copy and paste your code over to the new files and try it again.
Hope that helps.
Hope that helps.
Have you tried it with a \n after the 'this'? It may not be getting a chance to flush the buffer to console.
Why don't you post an example program (run the program, and post it)? If the one you already posted does that, then... wow. But you HAVE to run it first, there may be something else.
Does it work on any other projects? If not then reinstall your compiler.
Dont worry you still have for loops and as we all know:
for > while
Some people are langauge nazis, well I am a keyword nazi.
j/k.
Dont worry you still have for loops and as we all know:
for > while
Some people are langauge nazis, well I am a keyword nazi.
j/k.
Quote:Original post by Zahlman
Have you tried it with a \n after the 'this'? It may not be getting a chance to flush the buffer to console.
\n doesn't flush the buffer, it just prints a newline, you might be thinking of endl.
'while' isn't broken, it's your printf that isn't outputting anything.
Just use the keyword as you would normally instead of making unrealistic loops that don't flush the output buffer or something.
Just use the keyword as you would normally instead of making unrealistic loops that don't flush the output buffer or something.
Quote:Original post by RoboguyQuote:Original post by Zahlman
Have you tried it with a \n after the 'this'? It may not be getting a chance to flush the buffer to console.
\n doesn't flush the buffer, it just prints a newline, you might be thinking of endl.
A newline usually flushes FILE streams.
Interactive streams are eighter line buffered (setvbuf(stream, NULL, _IOLBF, 0)) or completely unbuffered (setvbuf(stream, NULL, _IONBF, 0)), except stderr which is guaranteed to be unbuffered.
All Unix machines I've encountered has been buffered although I suspect that Win32 uses unbuffered mode (or has special handling for the console).
Quote:MSDN
_IOLBF
For some systems, this provides line buffering. However, for Win32, the behavior is the same as _IOFBF - Full Buffering.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement