On Wed, 05 Apr 2006 11:02:37 -0500, Jim Strathmeyer wrote:
[ <fstream> vs <fstream.h> ]
> kobuscrispi.TakeThisOut@gmail.com schrieb:
>> How are they different, exactly?
>
> Just that the .h includes are deprecated, I think for all the standard
> headers. There's no real way you would know unless someone told you.
Well, that's true for the c-style headers. So for <string.h> for example,
the only difference between <cstring> and <string.h> is that all entities
in <cstring> are only in the std:: namespace, whereas they're in both
the std:: and the global namespaces for <string.h>.
Of course there are exceptions, such as the "float abs(float, float)"
overload in <cstdlib> which doesn't appear in <stdlib.h>.
> There should be no functional difference, though, except if you
> distributed your code my compiler would force me to change it manually.
For <fstream> though, and this is true of almost the entire <iostream>
hierarchy, there are differences. Older versions used strstreams
(often shortened to <strstrea.h>), which were char * based rather than
modern stringstreams.
Moral: You're using the modern library and getting better support if you
use the modern style rather than relying on the deprecated headers and
library support.
Cheers,
Adam
>> Stay informed about: PDcurses incompatibility with fstream.h?