by Martin Wed Dec 02, 2009 11:14 am
cookie! [NK] wrote:Hehe, i am not even near advanced for a teacher.
Martin, do you know something simpler than c/c++?
Sure
here is "hello world" example: you need g++ packages have installed
1)open console and write:vim hello_world.cpp
2)press i and write this text:
//this is standart library
#include <iostream>
using namespace std;//not so important for now
int main() //main function -> usually all programs start here
{
cout << "Hello world " << endl; //this will print text Hello world on standart output
return 0; //return code
}
3) save file and exit. in bash write:g++ hello_world.cpp
4)execute program by writing : ./a.out
That's all