Sign in to follow this  

I just want some ListdataType classes to work with

This topic is 3591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently using Dev-Cpp, but apparently that doesn't come with STL? I found a website documenting STL here: here
Quote:
This is a short primer on the STL or "Standard Template Library" for the programming language C++ as defined in the 1997 standard.
I downloaded the .h files and placed them into the /includes folder and wrote code as they have on the site, but I'm still receiving errors. Is there a recommended and convenient way to import a header file and off the bat be able to begin using classes such as a generic LinkList? I think Java has spoiled me a bit. I'm frustrated with C++ because I've already written LinkList classes before, I can't justify reinventing the wheel and I'm not cozy enough with C++ to catch all my errors with pointers and such, surely there is a more standard/graceful way.

Share this post


Link to post
Share on other sites
I'm pretty sure STL is part of the default Dev-C++ install. At least if you installed the Dev-C++ with MingW compiler tools bundle for windows.

I don't think installing STL by copy/paste the header files is recommended either.

Make sure you include the header files without the .h extension. Eg.

#include <list> // Right
#include <list.h> // Wrong

If that doesn't help you could always try to reinstall Dev-C++

Share this post


Link to post
Share on other sites
Quote:
Original post by sakatius
I downloaded the .h files and placed them into the /includes folder and wrote code as they have on the site, but I'm still receiving errors. Is there a recommended and convenient way to import a header file and off the bat be able to begin using classes such as a generic LinkList?


The class is called 'list', it is in the namespace 'std' (so you write std::list, if you aren't 'using' the namespace or the list declaration), and it comes from the header '<list>' (no .h). If it doesn't work, something is wrong with your installation.

(Also, surely you can spare a couple of extra letters to describe your own effort as a LinkedList. After all, the links may be how you make the list, but they're not *what you store*.)

Share this post


Link to post
Share on other sites

This topic is 3591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this