|
From: Teodorescu C. <te...@xt...> - 2003-02-25 10:05:23
|
Vlada Djurovic wrote:
>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?
>
>
In c++ you have libraries like <iostream> old name was <iostream.h> and
in C++ 98 standard was renamed.
on the other hand stdlib.h is not a c++ standard library is a C standard
so his name remains the same because C standard has .h names
In other words :
iostream is a C++ stadard library
stdlib.h is a C standard library
becarefull at string
<string> contains class string
<string.h> contains C like functions for manipulating strings
My sugestions:
1:Use only one set of libreries like either from C++ or from C never
mixed up especialy when you use pointers.
2:Take a look at a C++ standard and the diff betwen C and C++
|