Solved

What is exactly meant by "flag" in computer programming?

Posted on 2007-04-01
2
648 Views
Last Modified: 2008-02-01
Word "flag" is used in computer programming almost on a daily basis.  A example of usage of this word is as follows:

Some car object property might be a flag representing whether or not the motor is running.  What is exaclty meant by flag?

Thanks.
0
Comment
Question by:naseeam
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 18834066
See http://en.wikipedia.org/wiki/Flag_%28computing%29 - I could not sum that up better: "In computer programming, flag refers to one or more bits that are used to store a binary value or code that has an assigned meaning."
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 18834730
Compare it to the expression : "flag something", as in mark it for some given purpose. A flag is just a mark that is either set or not for whatever reason you need it.

Usually it's only 1 bit - several flags can be grouped together (and often are) into one multi-bit value.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now