How do I represent an integer in hexidecimal form in the code?

This is a discussion on How do I represent an integer in hexidecimal form in the code? within the C++ Programming forums, part of the General Programming Boards category; How do I use the hexidecimal system in my code? Something like... Code: int my_int = F61B; And other numbering ...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    40

    How do I represent an integer in hexidecimal form in the code?

    How do I use the hexidecimal system in my code? Something like...
    Code:
    int my_int = F61B;
    And other numbering systems for that matter, though hexidecimal is the only one I actually need for the moment. By "other systems", I mean binary and possibly octal if it is supported.

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    http://msdn2.microsoft.com/en-US/library/2k2xf226.aspx

    you can't use constants in binary form. If you know hex or octals well, that should suffice.

    edit: that's a page for the C standard, but C++ uses the same.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 08:34 AM
  2. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  3. Replies: 4
    Last Post: 01-16-2002, 12:04 AM
  4. Help with a bit of tweeking on form feed
    By breed in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 06:45 AM
  5. Porting code form *nix to win
    By Merlion in forum C Programming
    Replies: 2
    Last Post: 11-23-2001, 02:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21