I always see something like this::
Just for the record C++ is an Object Oriented Programming LanguageCode:// wrong, but it works!
#include <iostream>
int main()
{
std::cout<<"Hello, World!\n";
return 0;
}
So why teach in a non-object oriented manner?
Its not much more complex than the first example.Code://this is more acceptable
#include <iostream>
class cProgram{
public:
cProgram(){ std::cout << "Hello, World!\n"; }
~cProgram(){ std::cout << "Good bye, World!\n"; }
}
cProgram myApp;
int main()
{
return 0;
}
And well worth learning.
Lets see some fance hello_world.cpp code.