Default value of bool 's

This is a discussion on Default value of bool 's within the C++ Programming forums, part of the General Programming Boards category; I declared a large array of bools...and wrote a loop to make all the values false. The compiler(gcc-4.6) shows a ...

  1. #1
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490

    Default value of bool 's

    I declared a large array of bools...and wrote a loop to make all the values false.
    The compiler(gcc-4.6) shows a warning that "The statement has no effect"
    Is the default value of a boolean always && everywhere false ?
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    1,602
    Quote Originally Posted by manasij7479 View Post
    Is the default value of a boolean always && everywhere false ?
    No.
    That warning is generated when you do an operation but don't store the result.
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bool
    By anirban in forum C Programming
    Replies: 10
    Last Post: 06-08-2008, 12:59 AM
  2. BOOL bool ? unresolved external symbol
    By xwielder in forum C Programming
    Replies: 6
    Last Post: 05-20-2008, 08:39 AM
  3. How get bool's from std::vector<bool>
    By 6tr6tr in forum C++ Programming
    Replies: 6
    Last Post: 04-14-2008, 05:24 AM
  4. bool
    By Scarvenger in forum C++ Programming
    Replies: 2
    Last Post: 12-05-2005, 05:02 PM
  5. Interesting: bool != BOOL
    By lightatdawn in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 01-09-2002, 10:09 AM

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