+ 1
Can anyone explain what is bool and flag in c Programming .
bool data type flag with example
1 Answer
+ 2
bool stands for boolean, boolean is a value that can be only 1 of 2 states true or false, or on or off, or 1 or 0 these all represent the same thing, a flag is a variable that is used in a conditional.
i am unfamiliar with c language but i will show you in pseudo code
below the word continue is our flag
boolean continue = true;
while(continue){
do some things
continue = false;
}
once our flag continue is set to false the loop will break.