Thread: Bool

  1. #1
    Registered User
    Join Date
    Dec 2001

    Question Bool

    Final program of the year, everything is written except for the few lines of code dealing with bool. Everything I've come across for bool is basically vague references. If someone could help me with the following or point me in the right direction it would be greatly appreciated!!

    The main program itself is dealing with abstract base classes and derivation (each class has the 2 functions getdata and showdata). The part I'm having trouble with:

    In one of the derived classes, one data member is called "hitch" which is defined as bool. A hint was given..."for the hitch enter a value into another field and then use that field to control setting the hitch field to true or false."

    I feel like such a twit since we are so far into C++, that I can't deal with something that should be so "simple." Like I said, any help would be appreciated!!!

    Thanks again,

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    bool returns one of two values, true or false. For instance:
    bool checkEquiv(int x, int y){
        if(x != y) return FALSE;
        return TRUE;
    Simple as that, it's just a variable that holds one or the other.

    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. passing params between managed c++ and unmanaged c++
    By cechen in forum C++ Programming
    Replies: 11
    Last Post: 02-03-2009, 08:46 AM
  2. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  3. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  4. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM
  5. Need Help With an RPG Style Game
    By JayDog in forum Game Programming
    Replies: 6
    Last Post: 03-30-2003, 08:43 PM