Boolean Fundamental Type in Action : boolean « Data Type « Visual C++ .NET






Boolean Fundamental Type in Action

 
#include "stdafx.h"
using namespace System;


void main()
{
    bool a = 18757;   // will give a warning but set to true
    bool b = 0;       // false
    bool c = true;    // obviously true
    bool d = false;   // obviously false

    Console::WriteLine( a );
    Console::WriteLine( b );
    Console::WriteLine( c );
    Console::WriteLine( d );
}

   
  








Related examples in the same category

1.Boolean literals are objects too
2.Boolean Literals in Action
3.Boolean Literal and casting
4.Boolean Literal and toString