how to #define INT MAX?

This is a discussion on how to #define INT MAX? within the C Programming forums, part of the General Programming Boards category; Code: #include<stdio.h> #include<limits.h> #define MAXIMUM INT MAX . . quo=x/MAXIMUM; . is it Okay to define MAXIMUM to the value ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    22

    how to #define INT MAX?

    Code:
    #include<stdio.h> 
    #include<limits.h>
    #define MAXIMUM INT MAX
    .
    .
    quo=x/MAXIMUM;
    .
    is it Okay to define MAXIMUM to the value of INT MAX?
    quo=x/MAXIMUM; warning statement has no effedt

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >#define MAXIMUM INT MAX
    It should be:
    Code:
    /* Notice the underscore */
    #define MAXIMUM INT_MAX
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    22
    whoohooo it works!

    THX!

    I need new glasses

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer within a Struct
    By Bladactania in forum C Programming
    Replies: 11
    Last Post: 04-03-2009, 10:20 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  4. Help getting multiple keypresses in a DOS compiler
    By Nongan in forum Game Programming
    Replies: 2
    Last Post: 04-01-2005, 09:07 PM
  5. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM

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