This preview shows page 1. Sign up to view the full content.
Unformatted text preview: en is called console/terminal output
x Default keyboard is called console/terminal input
x This technically needs the concepts of classes, objects,
This namespaces, standard includes, etc.
namespaces, We’ll start with a simpler version
We’ll 25 Console output in C++
std::cout << “Hello World!” << std::endl;
} 26 Including files
xThis instruction specifies that a file, called “ iostream”, is to
is be automatically included at the beginning of the source
xThis file contains the declaration of various classes to
This manipulate the console input/output
xMultiple header files exist iostream: for input/outut cmath: for basic math functions (e.g., sqrt)
27 Common pitfalls with includes
x Forgetting to include a header file
x Including files in the wrong order, for dependent headers Note: if it is well programmed, this problem should never arise
x Including a header that includes itself, without protection example: #...
View Full Document
- Fall '00