Before go any further, can you answer these simple questions?
1. How long have you been programming in C, Java or scripting Bash?
2. Do you make any useful programs or involved in any project in development (in this case - programming)
3. Which type programmer you are? Casual programmer, hobbyist programmer, professional programmer?
cout error is probably because of -
1. You don't include header library - iostream (for input/output stream)
2. You don't declare the use of the method/class in iostream - using namespace std / std::cout
If you wanna compile a simple example, here it is
Code:
/* hello.cpp -- This print "Hello, World!" string. */
#include <iostream> // This include input/output stream header library, if you programming in C, it's just a bit same with <stdio.h>
using namespace std; // This declare of using standard method in <iostream>, you will understand better in OO's lesson.
int main() // Program start here
{
cout << "Hello, World!" << endl; // cout mean print and endl mean 'endline', endl is same with '\n' in C.
return 0; // This terminate the program and return 0 to OS
} // This end the block of int main
compile this with this command
I'm using vim as my text editor, it's very easy to use and fun.
Bookmarks