View Single Post
Old 10-22-2004, 06:44 PM   #7 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Quote:
quote:
--------------------------------------------------------------------------------

- iostream.h / math.h
In that case, the above headers do not exist in standard C++. Old.

--------------------------------------------------------------------------------



sure they do. backwards compatibility is maintained with older versions of c++ and with c, and they are legitimate to use.
True that, but that's not what I mean lol.
C++ actually requires one to use the new header file names. I've got some info for you from the ISO C++ Handbook:
Quote:
Chapter 2: standard briefing
Standard C Headers in the form <name.h>
For compatibility with the Standard C library, C++ still supports the naming convention of C headers in the form
<xxx.h> -- but this naming convention is now deprecated (this is discussed in more detail in Chapter 8).

Chapter 8: namespaces
Standard Headers Names
All Standard C++ header files now have to be included as follows:
#include <iostream> //note: no ".h" extension
Here is from the current ISO-IEC C++ standard:
Quote:
17.4.1.2 Headers
1 The elements of the C++ Standard Library are declared or defined (as appropriate) in a header.158)
2 The C++ Standard Library provides 32 C++ headers, as shown in Table 11:
Table 11—C++ Library Headers
_ __________________________________________________ ____________________
<algorithm> <iomanip> <list> <ostream> <streambuf>
<bitset> <ios> <locale> <queue> <string>
<complex> <iosfwd> <map> <set> <typeinfo>
<deque> <iostream> <memory> <sstream> <utility>
<exception> <istream> <new> <stack> <valarray>
<fstream> <iterator> <numeric> <stdexcept> <vector>
<functional> <limits> _ __________________________________________________ ____________________ ç ç
ç
ç
ç
ç
ç
ç
ç
ç ç ç ç ç ç ç ç ç
3 The facilities of the Standard C Library are provided in 18 additional headers, as shown in Table 12:
Table 12—C++ Headers for C Library Facilities
_ __________________________________________________ ___
<cassert> <ciso646> <csetjmp> <cstdio> <ctime>
<cctype> <climits> <csignal> <cstdlib> <cwchar>
<cerrno> <clocale> <cstdarg> <cstring> <cwctype>
<cfloat> <cmath> <cstddef> _ __________________________________________________ ___ ç
ç
ç
ç
ç
ç ç ç ç ç
4 Except as noted in clauses 18 through 27, the contents of each header cname shall be the same as that of the
corresponding header name.h, as specified in ISO/IEC 9899:1990 Programming Languages C (Clause 7),
or ISO/IEC:1990 Programming Languages—C AMENDMENT 1: C Integrity, (Clause 7), as appropriate,
as if by inclusion. In the C++ Standard Library, however, the declarations and definitions (except for
names which are defined as macros in C) are within namespace scope (3.3.5) of the namespace std.
Quote:
17.4.4.1 Headers
1 A C++ header may include other C++ headers.170)
2 Certain types and macros are defined in more than one header. For such an entity, a second or subsequent
header that also defines it may be included after the header that provides its initial definition (3.2).
3 Header inclusion is limited as follows:
— The C headers ( .h form, described in Annex D, D.5) shall include only their corresponding C++
header, as described above (17.4.1.2).
Basically, the .h extension is deprecated because the .h headers are at global space. Exactly the thing that the standard tries to avoid.
I'd thought you'd like to read this a lil. By they way, you know you can order the standard(s) right? It's just under $20. Just a heads up .
__________________
Valmont is offline   Reply With Quote