Thread: How do I fix these annoying warnings and errors?

  1. #16
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Yeah either do as tabstop said (which is the most correct answer) or you could do something more convoluted and change

    Code:
    #define LESS(x,y) ((x).income < (y).income)
    to

    Code:
    #define LESS(x,y) ((x).income > (y).income)
    Which is going to do kinda sorta what you want, yet not really what the rest of us would consider sensible.

  2. #17
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by master5001 View Post
    Yeah either do as tabstop said (which is the most correct answer) or you could do something more convoluted and change

    Code:
    #define LESS(x,y) ((x).income < (y).income)
    to

    Code:
    #define LESS(x,y) ((x).income > (y).income)
    Which is going to do kinda sorta what you want, yet not really what the rest of us would consider sensible.
    Actually that wouldn't help, since the problem is that the for-loops don't even trigger.

    It is something to keep in mind for the next IOCCC, though.

  3. #18
    Registered User
    Join Date
    Oct 2008
    Posts
    31
    works like a dream, with some minor revisions from master's code.

    Thanks much everyone!

  4. #19
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Psh.. my code was your code with some corrections. I just forgot to be a mind-reader today. No problem. You are the first to refer to a bubble sort as working like a dream

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 11-06-2008, 04:06 AM
  2. Definitions for gcc errors and warnings?
    By cpjust in forum C Programming
    Replies: 12
    Last Post: 10-04-2007, 09:18 AM
  3. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 05:44 PM
  4. Some errors and warnings i dont understand
    By lakai02 in forum C Programming
    Replies: 6
    Last Post: 10-18-2002, 11:16 AM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM