A while loop will only execute while the condition/expression evaluates to true. Is it True?
A while loop will only execute while the condition/expression evaluates to true. Is it True?
What the...
Yeah, but the condition is only checked each time it loops around.
Warning: Have doubt in anything I post.
GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101
Code:#include <stdio.h> int main ( ) { while ( 0 ) printf("No it's not\n" ); return 0; }
Or, rather:
Code:#include <iostream> int main(void) { while(0) std::cout << "No it's not\n"; return 0; }
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
you can do
while(1)
while(true)
while(0)
while(false)
all mean the same thing basically,
think you can even do
while(10000000000000) //just as long as its higher than 1
Equal but opposite.while(1)
while(true)
while(0)
while(false)
all mean the same thing basically,
You might get something like "number is so long that it is unsigned".think you can even do
while(10000000000000) //just as long as its higher than 1
The question has nothing to do with 10000000000000.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.