Computing.Net > Forums > Programming > representing binary number in C

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

representing binary number in C

Reply to Message Icon

Name: WTK
Date: September 11, 2002 at 23:03:52 Pacific
OS: linux
CPU/Ram: ??
Comment:

Hi,

well, in C we can initialize an int this way:

int dec = 10;
int hex = 0xA;

but how to do this using binary number(representation),
eg. int bin = 1010b; ???

thanks a lot

WTK



Sponsored Link
Ads by Google

Response Number 1
Name: Jim
Date: September 11, 2002 at 23:47:16 Pacific
Reply:

Apparently, it's 0b1010 or 0B1010.

At least that's what it says here.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: representing binary number in C

Number to Binary in C? www.computing.net/answers/programming/number-to-binary-in-c/9326.html

Binary Search in C. Help Please! www.computing.net/answers/programming/binary-search-in-c-help-please/6847.html

binary representation in C www.computing.net/answers/programming/binary-representation-in-c/7034.html