Sunday, 2 November 2014

By Using binary number in C or C++

Many C learner face the problem of initializing a variable with binary value or assign a integer variable with binary values. Don't worry its very easy as described in C you can use 0x for hex, 0 for octal similarly 0b defines binary. for example if you want to assign binary 1101 (i.e 13) to variable. then use this
int var = 0b1101;

No comments:

Post a Comment