Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 9th, 2012, 12:09 PM
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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle boolean datatype?? schockp Oracle 13 March 1st, 2007 08:24 PM
boolean starlightt Java Basics 2 April 6th, 2006 05:34 PM
Oracle Boolean Datatype Fireball Oracle 1 April 26th, 2004 05:46 PM
Random Numbers not so random... katsarosj ASP.NET 1.0 and 1.1 Basics 5 November 20th, 2003 12:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.