Wednesday, January 2, 2008

Intro to C programming

all programming like a baby,starts with simple development
a baby first say few words then more as they grow old

like babies we will start to the simpliest

here is the complete simplest but most famous program

the hello world program

#include

main()
{
Printf("Hello world!");
}


thats a running shortest program possible


here is some extended explanation on that


#include
this will indicate that when you will compile a standalone .exe file,
it will include the library and all commands will be read by this liblary
therefore for some specific commands you will need specific liblary file
to include to the .exe file the least the include, the faster the program loads

main()
this indicates a declaration of a function, named main

{
this indicate the start of function main


printf("Hello World");
this will print in the screen the string and/or number inside the quotation mark ("") this may also print variables to be discussed soon

now notice the ";" after the parenthesis
this semi colon indicates the end of the line
one at a time, the program runs one per line

you will only use this in commands that can be
placed inside a function like main() in this example



}

indicates the end of function main