I'm still a total newb in terms of programming
Started to learn C++ from a book recently and I've got the following question.
Even though \t(don't know proper description jet) is correct (did check other sources via google search)
it does not seem to do what it should do.
Code I am supposed to use is as follows
Spoiler
Show
Code: Select all
1: // Listing 2.2 zeigt die Verwendung von cout
2: #include <iostream.h>
3: int main()
4: {
5: cout << "Hallo dort.\n";
6: cout << "Hier ist 5: " << 5 << "\n";
7: cout << "Der Manipulator endl beginnt eine neue Zeile.";
8: cout <<
9: endl;
10: cout << "Hier ist eine große Zahl:\t" << 70000 << endl;
11: cout << "Hier ist die Summe von 8 und 5:\t" << 8+5 << endl;
12: cout << "Hier ist ein Bruch:\t\t" << (float) 5/8 << endl;
13: cout << "Und eine riesengroße Zahl:\t";
14: cout << (double) 7000 * 7000 <<
15: endl;
16: cout << "Vergessen Sie nicht, Jesse Liberty durch Ihren Namen"
" zu ersetzen...\n";
17: cout << "Jesse Liberty ist ein C++-Programmierer!\n";
18: return 0;
19: }
After compiling and running it on my end the tabulator doesn't seem to work.
My hope is that someone who knows more than me can point me to possible errors I've made
Pm would also be fine if answering it within this thread could spawn unwanted discussion.
My Typed out version for comparison
Spoiler
Show
Code: Select all
# include <iostream>
using namespace std;
int main()
{
cout << "Hallo dort\n";
cout << "Hier ist die 5: " << 5 << "\n";
cout << "Der Manipulator endl beginnt eine neue Zeile.";
cout <<
endl;
cout << "Hier ist eine grosse Zahl:\t" << 70000 << endl;
cout << "Hier ist die Summe von 8 und 5:\t" << 8+5 << endl;
cout << "Hier ist ein Bruch:\t\t" << (float) 5/8 << endl;
cout << "Und hier eine riesengrosse Zahl:\t";
cout << (double) 7000 * 7000 <<
endl;
cout << "Vergessen sie nicht, Jesse Liberty durch ihren Namen"
" zu ersetzen...\n";
cout << "Jesse Liberty ist ein C++-Programmierer!\n";
return 0;
}