This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

binary notation

I just started using keil c51 compiler.
Since I know that keil is compatible to ANSI-C
I want to know if there is an ANSI-C
compatible notation for binary numbers.

Like when I want to write the number in hexadecimal notation
I use the prefix "0x"
->
0xFF

All oher numbers are considered to be in
decimal notation.
->
1234567890

But which prefix do I use for binary number system?

I already tried (0b..., ...b, ...) and got
->error C251: illegal octal digit
->error C141: syntax error near 'b'
...

By the way, it would be nice to know which notation to use for octal number systems.

Regards
J.

Parents
  • "I want to know if there is an ANSI-C compatible notation for binary numbers."

    There is a very simple and straightforward answer to this:

    NO!

    "I just started using keil c51 compiler."

    It sounds like you have just started using any form of 'C'?

    The 'C' programming language has never supported a binary notation, so no decent textbook would have given you the idea that it did.

    "it would be nice to know which notation to use for octal number systems"

    Now this is absolutely standard 'C' stuff - see any good 'C' textbook.

    It sounds like you really need to get yourself a good 'C' textbook, and actually take some systematic approach to learning the language

    Here are some book lists:
    http://www.keil.com/books/8051books.asp
    http://www.8052.com/books.phtml

    If possible, you should do a taught 'C' training course.
    If you say where you are, people may be able to recommend one.

Reply
  • "I want to know if there is an ANSI-C compatible notation for binary numbers."

    There is a very simple and straightforward answer to this:

    NO!

    "I just started using keil c51 compiler."

    It sounds like you have just started using any form of 'C'?

    The 'C' programming language has never supported a binary notation, so no decent textbook would have given you the idea that it did.

    "it would be nice to know which notation to use for octal number systems"

    Now this is absolutely standard 'C' stuff - see any good 'C' textbook.

    It sounds like you really need to get yourself a good 'C' textbook, and actually take some systematic approach to learning the language

    Here are some book lists:
    http://www.keil.com/books/8051books.asp
    http://www.8052.com/books.phtml

    If possible, you should do a taught 'C' training course.
    If you say where you are, people may be able to recommend one.

Children
No data