C and C++ are old languages: unlike more modern ones like C# which don't care about definition order, they both insist that functions must be defined before they are used.
So when your
main
function tried to call
name_list_input
,
name_list_output
,
name_list_lastsort
, and
name_list_free
without a earlier defintion, the compiler complains that it can't find them in the current scope.
That's where
forward definitions
come in:
What are Forward declarations in C++ - GeeksforGeeks[
^]