You have to follow a function's parameter list to get a compile. Look at the signature of function addfront:
Originally Posted by Tryhard
You are expected to pass TheList, and Sorted * type variable in that order. So the string variable is wrong because it isn't the right type for either argument.
Thelist addfront(Thelist list, Sorted * AddmyChar)
Your code needs to decide which parameter is the list you want to add to and which parameter represents the node that you should add. When you make your decision, leave a comment, because it is not clear which parameter is which and if I am reading this right both type names are functionally the same type which is weird. Then you have to rewrite your function to deal with the following cases:
1. When the list you want to add to has no items.
2. When the item you want to add should be placed in the front of the list.
3. When the item you want to add should be placed in the middle of the list.
4. When the item you want to add should be placed in the back of the list.
It is possible that the 3rd and 4th case can be addressed by the same code, but that depends.
If the node you want to add will always look like:
name: <any name>
Then it should be possible.
Before the function can be considered complete something needs to be done with the pointer addmyChar inside of the type:
It is not clear to me what that pointer is for. And since both of the types Sorted * and Thelist have this pointer something must be done.
char * name;
Sorted * AddmyChar;
struct MyList * next;
Basically I'm trying to rephrase what other people have told you...