Thread: Just weird...I have the same number of variables

  1. #1
    Registered User arti's Avatar
    Join Date
    May 2010
    Posts
    108

    Unhappy Just weird...I have the same number of variables

    error:too few arguments to function a^qsorta^
    error:too few arguments to function a^qsorta^
    I don't know why it says that there are too few arguments when i have the same amount in both the prototype and declaration. What is going on?

    /*Prototype of the quick sort*/
    void quicksort(Emprecord Employeelist[], int start, int finish);




    void quicksort(Emprecord Employeelist[], int start, int finish)
    {
    Code:
     int left=start;
     int right=finish;
     char pivot[21];
     strcpy(pivot,Employeelist[(start+finish)/2].last);
     
     while(left<right)
     {
    Code:
       while(strcmp(Employeelist[left].last, pivot)<0)
         left++;
       while(strcmo(Employeelist[right].last,pivot)>0)
         right--;
       if (left<=right);
       {
    Code:
        Emprecord temp[1];
        temp[0]=Employeelist[left];
        Employeelist[left]=Employeelist[right];
        Employeelist[right]=temp[0];
          left++;
         right--;
    }
    } if(start<right) qsort(Employeelist, start, right); if(left<finish) qsort(Employeelist, finish, left);
    }

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Because qsort -- READ the error message, qsort, not quicksort -- takes four arguments not three. Presumably you didn't want to call qsort at all.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    You need to focus on your use of code tags. You have bits of code OUTSIDE code tags, and code tags NESTED within more code tags.

    It's
    [code]
    // ALL your code here
    [/code]
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Some weird issue.
    By dbzx in forum C Programming
    Replies: 7
    Last Post: 04-12-2009, 04:10 PM
  2. Random number + guessing game trouble
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-08-2007, 03:33 AM
  3. Stone Age Rumble
    By KONI in forum Contests Board
    Replies: 30
    Last Post: 04-02-2007, 09:53 PM
  4. Declaring an variable number of variables
    By Decrypt in forum C++ Programming
    Replies: 8
    Last Post: 02-27-2005, 04:46 PM
  5. Creating a student grade book-how?
    By Hopelessly confused in forum C Programming
    Replies: 5
    Last Post: 10-03-2002, 08:43 PM