Bei der (empfohlenen) Benutzung der neuen Headerfiles ändert sich unser
kleines Programm in (siehe HelloWorld_new.cc)
:
// Include file "iostream" is used instead of "iostream.h" #include <iostream> main() { // Scope operator :: is needed std::cout << "Hello World" << std::endl; } |
Ich will den Scope-Operator, siehe §8 nicht jedesmal
mitschreiben müssen, daher bevorzuge ich die Variante:
// Include file "iostream" is used instead of "iostream.h" #include <iostream> // All methods from class std can be used. using namespace std; int main() { cout << "Hello World" << endl; } |