Solved

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

Posted on 2007-04-01
2
661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

739 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