Sign in to follow this  
jolyqr

STL

Recommended Posts

by the way, what is the difference between :


#include <stdio.h>

and

#include <stdio>
using namespace std;

Share this post


Link to post
Share on other sites
If I remember correctly, there is a small difference - the <xxx.h>
variation brings stuff into the standard namespace (or sth like that)
They are there for backwards compatibility

Just use the one without the <xxx.h>

Share this post


Link to post
Share on other sites
Quote:
Original post by jolyqr
by the way, what is the difference between :


#include <stdio.h>

and

#include <stdio>
using namespace std;


I hope you mean <cstdio>

The first one is antiquated/deprecated in c++, and is included only for backward compatability. See here.

Share this post


Link to post
Share on other sites
A random STL tutorial

Just a google for 'STL tutorial' will show up many hits. Just be careful, if you stumble across a website which uses the STL headers ending in .h (#include <iostream.h> as opposed to #include <iostream>), scrap it, it is too old/non-standard. Standard C++ has the newer headers without .h suffix.

Edit: Damn I'm slow.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kitt3n
If I remember correctly, there is a small difference - the <xxx.h>
variation brings stuff into the standard namespace (or sth like that)
They are there for backwards compatibility

Just use the one without the <xxx.h>


using namespace std; does the same thing - brings stuff in current namespace.

Share this post


Link to post
Share on other sites
Be wary of anything you read on the web. There's a lot of misinformation out there. The best and only respectable reference/tutorial I know of for the C++ standard library ("STL" is an antiquated term that only coveres part of the library), is Nicolai Josuttis' book, "The C++ Standard Library". Found here:

http://www.amazon.com/gp/product/0201379260/sr=8-1/qid=1143926775/ref=pd_bbs_1/102-0254641-9177773?%5Fencoding=UTF8

Share this post


Link to post
Share on other sites
Quote:
Original post by jolyqr
Quote:
Original post by Kylotan
Moving to For Beginners.


euh... i think it's already there...


It was in AI when I saw this thread. Someone might have managed to move it a few seconds before I did.

Share this post


Link to post
Share on other sites

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