Thread: Default value of bool 's

  1. #1
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Chennai, India
    Posts
    2,645

    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 ?

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,119
    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, 01:59 AM
  2. BOOL bool ? unresolved external symbol
    By xwielder in forum C Programming
    Replies: 6
    Last Post: 05-20-2008, 09:39 AM
  3. How get bool's from std::vector<bool>
    By 6tr6tr in forum C++ Programming
    Replies: 6
    Last Post: 04-14-2008, 06:24 AM
  4. bool
    By Scarvenger in forum C++ Programming
    Replies: 2
    Last Post: 12-05-2005, 06:02 PM
  5. Interesting: bool != BOOL
    By lightatdawn in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 01-09-2002, 11:09 AM
Website Security Test