using iostream.h in Visual Studio 7.0
Hi all,
I have just port my C++ 6.0 project into C++ project of Visual Studio.NET. However, .NET tell me that it can not find iostream.h. Some search on the internet tell me that I should change the #include <iostream.h> into #include <iostream>.
Because my project is very big, It's very difficult to change like that.
Can anyone help me to use <iostream.h> in Visual Studio .NET ?
Thank in advance
[458 byte] By [
lhhai] at [2007-11-11 7:18:01]

# 1 Re: using iostream.h in Visual Studio 7.0
<iostream>
using namespace std;
Visual .net allows search and replace inside the entire project, however it might take a while if it is indeed very large. You are finallly seeing compilers that cannot handle the headers that were removed from the language -- the grace period is over.
Also, you will have more than the one I am sure. You probably used several headers that are no longer there. You only need the using statement once per include list (each of your .h and .cpp files that have includes).
jonnin at 2007-11-11 21:02:25 >

# 2 Re: using iostream.h in Visual Studio 7.0
<iostream.h> was deprecated a decade ago, and modern compilers don't offer it anymore (with reason). You normally can replace it with <iostream> and add a
using namespace std;
directive. Even in a large project, you really want to migrate to the standard compliant convention: <iostream> is so much better and cleaner than <iostream.h> and besides, you really have no choice. All modern compilers will insist on <iostream> so now is the right time for fixing your old code. It's painstaking but worth the investment.
You can find more guidelines about migrating from VC++ 6.0 here:
http://www.dev-archive.com/cplus/10MinuteSolution/28908
Danny at 2007-11-11 21:03:30 >

# 3 Re: using iostream.h in Visual Studio 7.0
I'm learning more about MFC and I'm learing from a book that uses "iostream.h" which is irritating as I normally use "iostream". I've not been programing in C++ fo rmore than 10 years so I'm not aware of the history of it all.
Is there a good webpage saying what the changes are so that I know what kind of differences I'm going to find? I'm also curious about why it was done.
Thanks.
Peter
# 4 Re: using iostream.h in Visual Studio 7.0
Danny wrote a nice book on it.
In general, everything (in the old headers) was wrapped in a namespace called std (not a disease, but cryptic for "standard"). A bunch of templates were added to standardize all the stuff everyone needs and used to write themselves (algorithms, containers, etc): its called the STL for standard template library. Casting variables around became MUCH more complex (overkill, actually). Added a bool type. Bunch of other stuff.
This was the best I could find in short notice:
http://david.tribble.com/text/cdiffs.htm
It outlines the difference between C and C++ but has C++ 1998 vs C and those are the changes you want to take a look at.
jonnin at 2007-11-11 21:05:29 >

# 5 Re: using iostream.h in Visual Studio 7.0
Here's my 1999 book:
http://www.amazon.com/gp/product/0789720221
It's dedicating to explaining all the differences between standard C++ and pre-standard C++: the changes, the rational behind them and a lot of techniques for writing high quality C++ code. BTW, you can borrow it from libraries or buy a second hand copy.
Danny at 2007-11-11 21:06:33 >
