Thread: Finding the next highest value in a int variable

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User spendotw's Avatar
    Join Date
    Dec 2011
    Location
    England
    Posts
    40
    Quote Originally Posted by oogabooga View Post
    Use struct process, not just process.
    Ahh thanks that got it to compile. Do i need to add anything to the comp function, such as comparison between int A and int B? Because when I run my program my output is this and it doesn't seem to be comparing the integers :s
    id: Process194
    Qaunta: 68
    Priority: 17
    sorted priority: 0
    id: Process195
    Qaunta: 127
    Priority: 7
    sorted priority: 0
    id: Process196
    Qaunta: 6
    Priority: 17
    sorted priority: 0
    id: Process197
    Qaunta: 103
    Priority: 18
    sorted priority: 0
    id: Process198
    Qaunta: 188
    Priority: 3
    sorted priority: 0

    As you can see all the priority that was suppose to be sorted by qsort returns 0's and not a list from 0 - 20

  2. #2
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    You need to post a complete program that demonstrates the problem.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with finding the highest average grade
    By Rockie in forum C++ Programming
    Replies: 4
    Last Post: 11-10-2011, 11:55 AM
  2. finding highest average
    By Vontrapp in forum C Programming
    Replies: 6
    Last Post: 06-07-2010, 06:38 AM
  3. C program for finding highest common factor!!
    By visham in forum C Programming
    Replies: 11
    Last Post: 08-02-2007, 07:10 AM
  4. finding highest number entered
    By volk in forum C++ Programming
    Replies: 11
    Last Post: 03-23-2003, 01:22 AM
  5. finding the type of a input variable
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2002, 08:40 AM

Tags for this Thread