bool vs int -- Which is faster?

This is a discussion on bool vs int -- Which is faster? within the C++ Programming forums, part of the General Programming Boards category; The real question is: do you have a profile telling you this code is a performance bottleneck? Just go with ...

  1. #16
    Registered User
    Join Date
    Dec 2004
    Location
    UK
    Posts
    109
    The real question is: do you have a profile telling you this code is a performance bottleneck?

    Just go with the type that fits the logic best (bool or possibly enum in this case). Worry about performance later.

  2. #17
    Kung Fu Kitty Angus's Avatar
    Join Date
    Oct 2008
    Location
    Montreal, Canada
    Posts
    115
    It would be the question if it called for empirical data.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 10:42 PM
  2. Drawing Program
    By Max_Payne in forum C++ Programming
    Replies: 21
    Last Post: 12-21-2007, 05:34 PM
  3. Moving Average Question
    By GCNDoug in forum C Programming
    Replies: 4
    Last Post: 04-24-2007, 12:05 AM
  4. newbie needs help with code
    By compudude86 in forum C Programming
    Replies: 6
    Last Post: 07-23-2006, 09:54 PM
  5. Converted from Dev-C++ 4 to Dev-C++ 5
    By Wraithan in forum C++ Programming
    Replies: 8
    Last Post: 12-03-2005, 07:45 AM

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