Static function error

H

hello

I am working on a programming project for my c++ class and I get this
weird error that I can get rid of. The method is a private method
that is supposed to copy a linked list to a new linked list and I get
this error: SortedList.cpp:190: error: expected constructor,
destructor, or type conversion before '*' token. The heading of the
function is this and ir errors on the same line:
ListNode *copyList (ListNode *L){}
 
I

Ian Collins

hello said:
I am working on a programming project for my c++ class and I get this
weird error that I can get rid of. The method is a private method
that is supposed to copy a linked list to a new linked list and I get
this error: SortedList.cpp:190: error: expected constructor,
destructor, or type conversion before '*' token. The heading of the
function is this and ir errors on the same line:
ListNode *copyList (ListNode *L){}

Is the declaration of ListNode in scope?

You should post a complete example that exhibits your problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top