Академический Документы
Профессиональный Документы
Культура Документы
Can any one explain whats the difference in the following usage?
1.
#include <iostream>
and
2.
#include <iostream.h>
Either can be used while coding, but if we use 1., then all keywords
Which usage is better? As I have been using 2. only and have recentlycome to know
about form 1.
The main difference between the Standard C++ library and previous run-time
libraries is in the iostream library. Details of the iostream implementation
have changed, and it may be necessary to rewrite parts of your code that use
iostream if you want to link with the Standard C++ library.
You will have to remove any old iostream headers (fstream.h, iomanip.h,
ios.h, iostream.h, istream.h, ostream.h, streamb.h, and strstrea.h) you have
included in your code and add one or more of the new Standard C++ iostream
headers (fstream, iomanip, ios, iosfwd, iostream, istream, ostream, sstream,
streambuf, and strstream, all without the .h extension).
If your old application is very iostream intensive, you may choose not to
link with the new Standard C++ library. In this case, leave the old iostream
headers in your code and the old iostream library will automatically be
linked. However, you cannot include any of the new Standard C++ library
headers. You cannot mix calls to the old iostream library and the new
Standard C++ library.
The following list describes behavior in the new Standard C++ iostream
library that differs from behavior in the old iostream library.
In the new Standard C++ iostream library:
open functions do not take a third parameter (the protection parameter).
You cannot open ofstream objects with the ios::out flag alone. The ios::out
flag must be combined with another ios enumerator in a logical OR; for
example, with ios::in or ios::app.
filebuf::openprot
filebuf::setmode
ios::bitalloc
ios::nocreate
ios::noreplace
ios::sync_with_stdio
streambuf::out_waiting