Results 1 to 2 of 2

Thread: Data Types

  1. #1

    Thread Starter
    Hyperactive Member Eyes.Only's Avatar
    Join Date
    Oct 2001
    Location
    Minnesota
    Posts
    347

    Data Types

    Im looking for c++ types equivilent to vb data types. I know most of them (Char and int and floating etc...) but ive never seen anything for Byte. Is there a 'Byte' or an equivilent to it in c++?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    C (and therefore C++) differentiates between signed and unsigned values, so a Byte is probably unsigned char, with a range from 0 to 255. A signed char is from -127 to 127.

    char = 1 byte
    short = 2 bytes
    int = 4 bytes
    long = 4 bytes



    Note: int is normally dependent on your compiler. If it is 16-bit, then it will probably be equivalent to short. On 32-bit (which you should be using) then it will be the same as long.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width