Current location - Health Preservation Learning Network - Slimming men and women - What is the flag in C language?
What is the flag in C language?
Flags represent variables in C language programming.

FLAG is originally a programming instruction, which is often used in computer languages, such as C or D, and is often used to record a parameter of a variable.

Flag has only 1 (stand up) and 0 (fall down), and is usually stored in a fixed area of memory. The program changes the value of flag while changing a certain state, and understands the state and decides the next operation through flag in other operations. In other words, flag can be used to help programs judge complex conditions.

Program example

int a;

flag:a = 1;

cout & lt& lta & lt& ltendl

Go to the sign;

a = 2;

cout & lt& lta & lt& ltendl

Program execution result: infinite loop output 1

The above contents refer to Baidu Encyclopedia -—FLAG.