Thread: Looking for a macro that takes four arguments and returns the largest value?

  1. #1
    Unregistered
    Guest

    Question Looking for a macro that takes four arguments and returns the largest value?

    Looking for a macro that takes four arguments and returns the largest value?

    #define MAX4 (A, B, C, D)

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    >Looking for a macro that takes four arguments and returns the
    >largest value?

    No, I'm not looking for such, but I guess you are.

    Code:
    #define MAX4(a,b,c,d) ((((a > b) ? a : b) > c) ? ((a > b) ? a : b) : c) > d ? \
                          ((((a > b) ? a : b) > c) ? ((a > b) ? a : b) : c) : d
    Last edited by Shiro; 05-05-2002 at 09:26 AM.

  3. #3
    Unregistered
    Guest

    Cool thnx :)

    thnx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. NULL arguments in a shell program
    By gregulator in forum C Programming
    Replies: 4
    Last Post: 04-15-2004, 10:48 AM