Help I'm new

This is a discussion on Help I'm new within the C Programming forums, part of the General Programming Boards category; I trying to write a program that does calculations, but I can not get a number bigger the 32000 into ...

  1. #1
    Unregistered
    Guest

    Unhappy Help I'm new

    I trying to write a program that does calculations, but I can not get a number bigger the 32000 into any of my varibles, if i do then it come out in negitive numbers. help please

  2. #2
    Unregistered
    Guest
    _Bool 1 Logical type, can be either zero or one.
    char 1 Character type. Comes in two flavors: signed or unsigned.
    short 2 Integer stored in 16 bits. Signed or unsigned.
    int 4 Integer stored in 32 bits. Signed or unsigned.
    long 4 Identical to int
    long long 8 Integer stored in 64 bits. Signed or unsigned.
    float 4 Floating-point single precision. (Approx 7 digits)
    double 8 Floating-point double precision. (Approx. 15 digits)

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    Cool

    Try using Long Interger ... It might work. (%ld)
    or use float but gives u decimal numbers. (%f) or (%.2f) to give u like 40292.23 instead of 233443.23233

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    23
    Hey,
    different compilers can have different sizes for ints types.. well actually.. ints are eaither the same size as a short (16-bits) or a long (32-bits),
    anyway thats not the point. if you have no need for negative numbers try unsigned int.. or just use a bigger type.
    hope i helped,

    ActionMan
    ActionMan

    "THE DAY IS MYNE!!!!
    I'll take famouse titties for $400"
    -Sean Connery, Saturday Night Live

Popular pages Recent additions subscribe to a feed

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