On Tue, 29 Aug 2006 18:17:54 -0700, Schizoid Man <sc***@sf.comwrote
in comp.lang.c++:
Kai-Uwe Bux wrote:
Schizoid Man wrote:
Is Div() a standard C++ function with iostream or cmath?
No.
It seems to be an incredibly useful function, and works well in Visual
C++.
The headers <iostreamor <cmathare allowed to import other headers: the
div() function is part of <cstdlib>.
Hi Kai,
Does <iostreamautomatically import <cstdlib>? Because all I have is
<iostreamand <cmath>.
One of the changes from C to C++ is in the inclusion of standard
headers.
The C standard specifically prohibits any standard C header from
including any other standard C header.
The C++ standard specifically allows any standard C++ header,
including those inherited from C, to include any other standard C++
header.
So apparently on your particular implementation either <iostreamor
<cmath>, or both, include <cstdlib>. But your next compiler, or even
the next version of your current compiler, might not do so. For the
sake of portability don't count on it, and always implicitly include
every standard header whose types, objects, macros, or functions you
use.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://c-faq.com/
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html