i half understand this code, just wondering if anybody could give me helpful tips/hints about understanding the difference between these two functions

extern status traverse( list L, status ( *p_func_f )() ){

  if( empty_list ( L ) ) return ( OK ) ;

  if( ( *p_func_f ) ( DATA( L ) ) == ERROR ) return ERROR ;


    return( traverse( NEXT(L), p_func_f ) );

extern list list_iterator( list L, list lastreturn ) {

  return ( lastreturn == NULL ) ? L : NEXT( lastreturn );

1) both functions use the extern keyword incorrectly. extern means it is coded in some other translation unit, which the code you posted is certainly not.

2) can't tell just what the difference is because I don't know what the macro NEXT does. My guess is that it is causing recursion.

both functions are found in list.c, defined in list.h and used in main.c

NEXT and DATA are both shortcuts for saying L -> next or L -> datapointer

The first function is recursive, while the second is not. For the second function to work you need other code to call it repetedly.