Yes, I know this question has been asked numerous times previously, however I am racking my brain trying to figure out what is causing the error as I cannot identify where the u
This time it's not a missing semicolon, but a completely different language. The code you're trying to compile is in C++, not C. That's why you get syntax errors from a C compiler.
To fix this (and compile the code as C++), rename the file from .c
to .cpp
:
mv list.c list.cpp
And use g++
to compile it, not gcc
:
g++ -o list list.cpp