bool

This is a discussion on bool within the C++ Programming forums, part of the General Programming Boards category; I cant get my compiler to accept bool types....any ideas what I can do about that?...

  1. #1
    Unregistered
    Guest

    bool

    I cant get my compiler to accept bool types....any ideas what I can do about that?

  2. #2
    Snior Member
    Join Date
    Jan 2002
    Posts
    982
    You could post it to a message board, giving vague info and not stating with compiler you're using.

    or you could do

    enum bool {false, true};

    or you could get a new compiler.

  3. #3
    Nor
    Nor is offline
    h ֆhr s Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    Originally posted by Sorensen
    You could post it to a message board, giving vague info and not stating with compiler you're using.

    or you could do

    enum bool {false, true};

    or you could get a new compiler.
    lol bad day?

    I cant get my compiler to accept bool types....any ideas what I can do about that?
    hummmmm...................................

    1. What compiler?

    2. Do you wish to post your code?
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

  4. #4
    Registered User toaster's Avatar
    Join Date
    Apr 2002
    Posts
    161
    lemme guess?
    Borland Turbo C++ 3.0 DOS compiler or something compatible/similar?

    if so, then just use a substitute: int
    to save some memory, then: short unsigned int
    even more memory efficient: char

    then do something like this:
    example:
    int i = 1; // substitute for i = true
    int i = 0; // substitute for i = false

    you can also do this for char:
    example:
    char i = 'I'; // true
    char i = 'O'; // false

    that's a good substitute for boolean types if you want.

    or in the Borland Turbo C++ 3.0 DOS library, use <limits.h>
    the online help provided with the program will help you.
    good luck!
    think only with code.
    write only with source.

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. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 08:05 AM
  3. DirectInput help
    By Muphin in forum Game Programming
    Replies: 2
    Last Post: 09-10-2005, 12:52 PM
  4. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 05: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

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