--- Siddhesh Poyarekar wrote:

> Hi All,

> This is probably a very basic question but here goes
> anyways 

Is it? 

> -- which
> would be faster in C/C++ (or would it make no
> difference at all?):

> while(condition)
> {
>   ...
> }
> 
> OR
> 
> while(true)
> {
>   ...
>   if(condition)
>     break;
>   ...
> }

I'm not sure, if my answer is correct, but I would
think of it in the following way. The compiler would
produce an appropriate code for each of /block-code/
mentioned above, and the one with less number of
instruction set, would (should?) perform faster. 

If this is part of a bigger program, using boolean
variables with while loop, could prove useful.

--
FSF of India Associate Fellow - http://www.gnu.org.in
http://www.somaiya.edu/sksasc
ubunturos @ freenode


      Why delete messages? Unlimited storage is just a click away. Go to 
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html

-- 
http://mm.glug-bom.org/mailman/listinfo/linuxers

Reply via email to