iostream includes string, because the stream objects need to know about
strings.
For instance, you can have:
string x = "hallo";
cout<<x;
so cout must have a method for handling strings.
On the other hand, strings do not have to know about streams.
So if you write code that does not use streams you have to explicitly
include <string> if you want to use strings.
----- Original Message -----
From: "Shawn" <tre...@gm...>
To: "Wobien" <roo...@pl...>
Cc: <dev...@li...>
Sent: Wednesday, February 20, 2008 3:50 PM
Subject: Re: [Dev-C++] no #include<string>
> Yes, I did include iostream and ctime.
>
> What's the point of include string then? Just more options regarding
> strings???
>
>
>
> Wobien wrote:
>> Did you include another include-file?
>> For instance #include <iostream> allso defines std::string
>>
>>
>> ----- Original Message ----- From: "Shawn" <tre...@gm...>
>> To: <dev...@li...>
>> Sent: Tuesday, February 19, 2008 9:05 PM
>> Subject: [Dev-C++] no #include<string>
>>
>>
>>> Has anyone ever tried to use strings and not import the string library?
>>> It's weird, I'm using them but 4got to include the library and my
>>> program is running!
>>>
>>> lol
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>>
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Dev-cpp-users mailing list
>>> Dev...@li...
>>> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>>> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>
|