lists

O

oogie

I was trying to declare a list of class objects in a class header file
and I kept getting the following errors in visual c++:

error C2143: syntax error : missing ';' before '<'
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
error C2238: unexpected token(s) preceding ';'

In the header file under private data members I had declared a list of
class objects:

private:
list<Clients> clientList;

Where Clients was an earlier defined class. Why is this incorrect? I
also included the <list> library.
 
I

Ian Collins

oogie said:
I was trying to declare a list of class objects in a class header file
and I kept getting the following errors in visual c++:

error C2143: syntax error : missing ';' before '<'
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
error C2238: unexpected token(s) preceding ';'

In the header file under private data members I had declared a list of
class objects:

private:
list<Clients> clientList;

Try

std::list said:
Where Clients was an earlier defined class. Why is this incorrect? I
also included the <list> library.
No, you included the <list> header.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top