Algorithm Design Guide, Chapter 3, Confusion of linked code snippets

I am reading the Algorithm Design Guide and the following code fragment appears in chapter 3. This is due to the removal of the item from the linked list. The question is not related to data structures, but only with one line of code, where I declare two variables. I have reduced the optional parts of the code for brevity.

list *search_list(list *l, item_type x) {
  // This function just searches the list x
}

list *predecessor_list(list *l, item_type x) {
  // This function simply returns the predecessor of x or NULL
}

delete_list(list **l, item_type x) {
  list *p;     /* item pointer */
  list *pred;  /* predecessor pointer */

  list *search_list(), *predecessor_list(); // What are these declarations?

  p = search_list(*l,x);

  // Code to delete the node if found is here    
}

My question is in delete_list function, in particular, in the line list *search_list(), *predecessor_list();. What is happening on this line? I assume this is a function pointer, but I understand that you must declare a function pointer with the appropriate parameters. Also, assuming I'm right, why do I need these lines?

+4
2

, ,

list *search_list(), *predecessor_list();

, identifier a function . (), , .

, C .

, Dabo, : int, float?

+3

, , search_list() predecessor_list() return list*. , , int. , search_list() predecessor_list() delete_list, .

delete_list , conflicting types for search_list(), , search_list() predecessor_list() int

+2

Source: https://habr.com/ru/post/1532417/


All Articles