linked list - Referring to "C - Help understanding how to write a function within a function (list_map)" -


I have only one professor: I've read the forum:

It is very useful in understanding the function, but I am not sure that I am using it right ...

This is my code. Tell me if I am on the right path. .

Let me assume that I have an array of 10 linked lists in which linked lists are present

Now I would like to sort the list that calls list_map (); Function

So my main looks like this:

  int x = 10; List * MyList [x]; Barzowo (Marylest, Psychof (LIIST *) * X); . . {// Segfalt list_map for (I = 0; i & lt; 10; i ++) (my list [i], sort);  Map  

My list_map looks like this:

  zero list_map (list * list, zero (* f) (zero *)) { Printf ("sort"); F (list); }  

and sort:

  zero type (list * n) {// sequence code}  

Error me when segmentation is a mistake when I run it.

Please excuse the lack of code, I work my sorting function, I have already tested it and it prints each list. If you need to see something in more detail then let me know that I will provide it.

Bergo does not allocate this memory beyond zero, using malloc

 < Code> int x = 10; List ** my list; Mylist = (list **) malloc (sizeof (LLIST *) * x); . . {// Segfalt list_map for (I = 0; i & lt; 10; i ++) (my list [i], sort); } Zero list_map (LLIST * list, zero (* f) (zero *)) {printf ("sort"); F (list); }  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -