yo people! this is out here for the noobs!!!
language: C++
difficulty: NEWBIE (3n3rgy)
program: compiler: google C++ Compiler
credits: freckles i think
1.Open a new empty win32 console application. Name it Hello.
2.Open a new c++ source file, name it hello.
3.Now in the source file we need to add the code...type
Code:
#include
this tells the compiling programs preprocessor to include the iostream standard input/output c++ library
4.now on a new line, add the command...
Code:
using namespace std;
All the elements of the standard C++ library are declared within what is called a namespace, the namespace with the name
std.
So in order to access its functionality we declare with this expression
that we will be using these entities. This line is very frequent in C++
programs that use the standard library, and in fact it will be included
in most of the source codes included in these tutorials.(explaination
thanks to
www.cplusplus.com 5.on another new line type the command...
Code:
int main()
This command defines where the program should begin from, every c++ needs this command.
6.Very simple method, we need to begin the actual program so type on a new line a simple Code:
{
this little 'watsamacallit' whatever is inside this little
'watsamacallit' and the finishing 'watsanacallit' is what happens when
the program is executed.
7.Ok now we need the program to do something once executed so type...
Code:
cout<<"Hello World! ";
cout<< is the standard output method of c++ code.
; defines the finish line of that command, everything within the 'watsamacallit''s need to finish with a ;
8.So close to finished!, on a new line type...
Code:
return 0;
The 'return 0' statment tells the main function to
finish.This is the most usual way to finish a c++ program, presuming it
worked well with no errors.
9.new line, finish it off with Code:
}
'WATSAMACALLIT' !!!
10.add some credits...same as et configs //
Code:
//This is Credits
//My c++ program!
11.Now we need to execute our program...from the menu
Build/Execute Hello.exe
you should get a console program up saying "Hello World!" press any key to continue
if not tell me what you got, hopefully i can help you.
If you can't do this. pleas close this site. turn off the pc and go watch TV.