|
From: <ri...@te...> - 2003-02-25 12:46:42
|
Vlada Djurovic escribió:
>Hi, everybody
>I hope someone can explain this to me. When I write this:
>
>#include <iostream>
>#include <stdlib>
>
>using namespace std;
>
>I get error like "stdlib: No such file or directory".
>When I write like this:
>#include <iostream>
>#include <stdlib.h>
>
>using namespace std;
>
>everything is fine. I thought that with "using namespace" you don't have
>specify file extension. Why does the compiler complain only about stdlib
>without .h? Can somebody please explain this?
>------------
>Vlada
>
>
>
The namespaces are used for STL (Standard Template Library) but stdlib.h
it´s a header for C library:
In a nut shell:
If you use the standard C library you must put .h for including headers
If you use STL you must not use .h and also type 'using namespace stl'
Cheers
|