What are Flags?

This is a discussion on What are Flags? within the C++ Programming forums, part of the General Programming Boards category; Probably a simple question. What are flags? Man this post is short! thanks...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    38

    What are Flags?

    Probably a simple question. What are flags? Man this post is short! thanks
    #include <Jesus.h>
    It will save your life

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Flags are settings, basically. Heres some flags for setting deimcal output to three spaces past the "."

    cout << setiosflags(ios::fixed | ios::right | ios::showpoint)
    << setprecision(3);

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    9
    Flags are variables a programmer uses to instead of logical conditions. For example suppose you read numbers from a file and you wish to find number 6. You create a loop and check if any number in the file matches 6. To terminate this loop you could use a flag, suppose an integer variable named 'found' which is equal to zero, until you find what you are looking for in the file. At that time found=1.

    while (found!=1) {
    ...
    }

    So this loop terminates when 'found' has the value of 1. That's more or less the concept of a flag.
    (Hope I was helpful...Maybe not! ;0) )

    P.S: STOP THE WAR IN IRAQ! DROP BUSH, NOT BOMBS!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. obtaining which combination of flags are being set
    By stanlvw in forum C++ Programming
    Replies: 4
    Last Post: 07-16-2008, 03:43 AM
  2. Cannot get interface flags: Invalid argument
    By nasim751 in forum C Programming
    Replies: 1
    Last Post: 04-15-2008, 03:27 AM
  3. Using 'flags'
    By cyreon in forum C++ Programming
    Replies: 11
    Last Post: 01-28-2008, 04:21 PM
  4. Bit Flags
    By Padawan in forum C Programming
    Replies: 15
    Last Post: 03-30-2004, 10:38 PM
  5. Flags, the ambiguity of
    By Jeremy G in forum C++ Programming
    Replies: 1
    Last Post: 01-25-2003, 11:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21