0

I am working on pset3 at the moment and while all problem sets so far had their challanges this one got me a little lost! I implemented search into helpers.c. Now I am supposed to implement sort. But I dont get where? Is it supposed to go under bool search(int value, int values[], int n ? And what is it actually sorting? Maybe it´s because I am not a native speaker but I can´t quite follow the task in this one... Maybe someone can kindly push me in the right direction? Thanks!

0

sort() will be another function in the program, like search() that goes inside the helpers.c file. It is a separate function, so it should not be placed inside of any of the other functions.

If you don't understand how to create a function, then it will help to review the shorts and class material on the subject.

[Edit]

The helpers.c file will follow the following structure.

// includes go first
#include ....

// function signatures 
return_type function1(parameters);
void function2(...);
...
int function_x(...);

// functions are next
return_type function1(parameters)
{
    // function code here
}

type function2(...)
{
    // function code here
}

// ... and so on.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

3
  • I am sorry. I don´t get in. Is it literally going into helpers.c or do I have to open a new file called sort.c??
    – user10882
    Apr 8 '16 at 18:09
  • It is literally going into helpers.c
    – Cliff B
    Apr 8 '16 at 18:28
  • Thank you very much!
    – user10882
    Apr 8 '16 at 19:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .