Boolean Literal and casting : boolean « Data Type « Visual C++ .NET






Boolean Literal and casting

 

#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;

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

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

   
  








Related examples in the same category

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