#include standard

W

Web Developer

Hi,

In Java, the package java.lang.*; is automatically imported and provides a
basic set of functionality.

Questions:
1) In C++, are there any include files that are automatically included? or
must I explicitly define one if i want to use a method from a particular
include file?
2) Where can I find a source for all include files? something that shows the
code and what methods are available etc.. since there is no API like there
is in Java.


WD
 
J

Jerry Coffin

[email protected] says... said:
1) In C++, are there any include files that are automatically included?
No.

or must I explicitly define one if i want to use a method from a particular
include file?

You must explicitly include it. Defining it would be something else
entirely.
2) Where can I find a source for all include files? something that shows the
code and what methods are available etc.. since there is no API like there
is in Java.

The C++ standard has definitions of what's required to be present in all
the standard headers. There are also a number of placed on the web
(e.g. at dinkumware.com) that have reference material.

Headers specific to your platform are presumably documented by the
implementation, though with no knowledge of the implementation it's hard
to guess at the form that might take.
 
V

Victor Bazarov

Web Developer said:
In Java, the package java.lang.*; is automatically imported and provides a
basic set of functionality.

Questions:
1) In C++, are there any include files that are automatically included?

There are no "include files" in C++ (except those you create yourself).
There are headers. And, no, none is automatically included.
or
must I explicitly define one if i want to use a method from a particular
include file?

If you need a certain library element and that library element is declared
in a certain header, you have to #include that header.
2) Where can I find a source for all include files?

Again, there are no "include files". However, the standard headers are
in fact files (although they are not required to be files by the language)
on all implementations I've seen so far. Consult with your compiler
documentation to know where it puts its library.
something that shows the
code and what methods are available etc.. since there is no API like there
is in Java.

There is API. Look in your compiler documentation and you will see that.

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top