Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 12-19-2006, 08:19 PM   #1 (permalink)
 
Junior Techie

Join Date: Feb 2006

Posts: 58

jeelliso

Default STL in Microsoft C++

Hello,

I'm a long time C++ programmer, but this is my first time compiling in Windows. I'm using Microsoft C++ Visual Studio Express 2005.

I'm creating a routing program for network simulation and I have a class called Neighbor (already defined). I need to make a "list" of them using the Standard Template Library. Here is the code I'm using:
Code:
list<*Neighbor> neighbors;
and here is the errors that result:
Code:
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 ';'
I found file file on the MSDN website with a similar example. I seem to have the syntax correct, but I can't get it to compile. I've also tried this with just an int instead of a Neighbor class object.

If I've missed something specific to Windows please let me know. Any other ideas are also welcome.

Thanks,
~Justin
__________________
~Justin
jeelliso is offline  
Old 01-03-2007, 02:51 AM   #2 (permalink)
 
Newb Techie

Join Date: Jan 2007

Posts: 25

ryno

Default

Code:
list<Neighbor*> neighbors

ryno is offline  
Old 01-04-2007, 05:01 PM   #3 (permalink)
 
Junior Techie

Join Date: Feb 2006

Posts: 58

jeelliso

Default

Quote:
list<Neighbor*> neighbors
Good call. Sometimes is just takes a pair of fresh eyes to pick up such a simple mistake.

Thanks,
__________________
~Justin
jeelliso is offline  
Old 01-04-2007, 05:03 PM   #4 (permalink)
 
Newb Techie

Join Date: Jan 2007

Posts: 25

ryno

Default

You're welcome.
ryno is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On