View Single Post
  #1 (permalink)  
Old April 9th, 2012, 12:09 PM
gautam12321 gautam12321 is offline
Registered User
 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default random value taken by datatype boolean

When we run the following program-

#include<iostream.h>
void main()
{
bool x;
cout<<x;
}

Why it gives values other than 0 or 1 though its data type being bool only possible values are true or flase and resulting display should be 0 or 1. I use
c-free 4.0 compiler to compile the programs. Thanks in advance.
-Gautam.
Reply With Quote