Kamis, 07 Juni 2012

Two New Data types in ANSI C++

The ISO/ANSI C++ adds two new Data types in C++.(1) bool ,(2) Wchar.

1. BOOL
                the dat type BOOL stands for boolean(true or false).the value true and false has been added to keyword set of  C++.It can be declared as follows:
bool b1;     // on different line
b1 = true;

OR

bool b2 = true; //on same line

default numeric value of  TRUE  is '1' and FALSE is '0'.
for example:
 cout < < "b1=" < < b1; 
will display:1.
we can also use TRUE and FALSE as value. for example
 int x = true + true ;
Will assign 2 to the variable X


2.WCHAR

WCHAR stands for wide character.It is used to represent 16-bit character,such as some japanese.you can declare wchare as follows
 wchar_t wh[]=L"hello"
cout < < wh ;
will output hexa decimal code for it. to print string on screen type
wcout < < wh; 
Protected by Copyscape Web Plagiarism Detector

See Also:

Xbox , minesweeper game , mozilla Firefox , gift , Christmas, fashion world

Tidak ada komentar:

Posting Komentar