Thread: Binary numbers
View Single Post
Re: Binary numbers
Old
  (#10)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Re: Binary numbers - 03-04-2004

Quote:
Originally Posted by Lazy
Thanks for the info, though I know how to use all of the operators I just wondered why I cannot just use a binary number.
What Lazy is asking, is how do I represent BINARY CONSTANTS in the c/c++ language.

lazy, you can't!!!
koraX is korrect!
c/c++ doesn't have a way to do this!

It has been proposed by the standards committee but as far as I know it hasn't been implemented by any compiler.

You have to convert the binary number to octal or hex, first then use the familiar c/c++ CONSTANTS SYNTAX:
0x<hex number>
0<octal number>

Last edited by Austin; 03-04-2004 at 12:14..
  
Reply With Quote