i have one question and please help me.i have read on web page somthing about do while statement,different is that ,in while there is written 0,not boolean condition
do{
// do some instruction
}while(condition );
is clearly understandable,but this one
do
{
//again some instruction
}while(0);
i can’t guess what does it do?is it equivalence it to this: do something while(false)?or maybe is it infinity loop?please help me
It does something only once. It is widely used in macros to group statements and make the usage more natural (i.e. require ending semicolon).
Any compiler worth its salt should ignore the do .. while altogether and just run the enclosed statements.