VS 2005 and Standard Template Library List where? (please)

Associate
Joined
4 Jun 2003
Posts
770
Location
United Kingdom
I have setup a standard windows c++ project, and I want to use a list.

My question is, where do I put the "#include <list>"?

After that is sorted, where can I declare a list e.g. "list <int> c0"?

I want to access the list as a result from the button press.

Thanks

P.S. Perhaps I'm going about this the wrong way? But it would be the easiest way to accomplish this simple task.
 
Just to be clear

Where do I put the #include - which file? (Form.h, project.cpp etc)

Where do I declare a list so that the entire programcan access it?

Thanks
 
For good programming practice, where should I declare a list instance?

#include still at the top of project.cpp I presume?
 
I want to access the list when a couple of buttons are pressed.

Should I create my own class, declare the list there and simply call class functions from the button presses?
 
Welshy said:
Sorry to be negative, or if it sounds like im insulting you, but do you actually know what your doing? In which case i'd say your getting too far ahead of yourself.

It's just your asking a lot of very basic questions

I know what I'm doing for the most part thanks, I'm a bit rusty on good C++ programming practice though. It has been quite some time since I programmed, I'm new to VS 2005 and never used the STL before.

Fancy answering my question on whether it would be a good idea to include the list in my own class (which will have other things in also) and access it through my own functions?
 
Something I'm not clear on is where I would create an instance of my own class so that I can access the class functions from multiple parts of the program.

I have Form1, which has a section for code when Button1 is pressed and another section for when Button2 is pressed.

How do I create in instance so that these two seperate buttons can access this?

This is probably a very stupid question, in fact, I know it is. I just can't remember.

edit

To be clear, this is a VS2005 created Win32 app, so it has created the sections for button presses. I believe it does this in the form of a class.

edit2

Not to worry. Got it sorted. I think I'm back on track now.
 
Last edited:
Back
Top Bottom