Solved

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

Posted on 2007-04-01
2
654 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

773 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