You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, February 8th 2007, 7:27am

c++ problems

Hi...i'm a beginner in c++ programming and i have a lot of problems,but my biggest one at the moment is this one: i have to create containers for some classes like CShape, CRectangle, CCircle (who derive from CShape ) and for creatin containers i was told to use the containers in STL or CLists,CArray from MFC.... i have been reading about STL containers...but i can't figure out how to conect my classes an the list container in STL...please help...

agallers11

Beginner

Posts: 55

Location: MD, US

Occupation: Programmer

  • Send private message

2

Thursday, February 8th 2007, 3:38pm

RE: c++ problems

Source code

1
2
#include <vector>
std::vector<YOUR CLASS TITLE IN HERE> myVector;

3

Saturday, February 10th 2007, 6:48am

i am a bit confused...is STL alreadya part of visual c++ 6.0 or do i have to dowload the library? if it is a part of it...what files do i need to include (except for..let's say "vector.h")? if it's not..where can i find the right version ? is there anything special i have to do with it?

agallers11

Beginner

Posts: 55

Location: MD, US

Occupation: Programmer

  • Send private message

4

Monday, February 12th 2007, 2:42pm

If you have visual studio than you have the STL libraries. All you'll have to do then is #include the specific files you want in your project. Heres a link to a listing of the STL libraries:
http://www.dinkumware.com/manuals/

p.s. - if you are using a vector or a list, besides #include <vector> and #include list, you should refer to your vector/list as std::vector or std::list.

e.g.)
#include <vector>
std::vector<What type it holds> myVector;

OR

at the top of the file type using std::vector; using std::list;