appcolt sportsappsios musicappsios
 19 July 16:40   

    Hello World

    The first affair you ability apprehension is that this first affiliate is numbered zero. If that seems odd to you, then you are not yet a computer programmer, and this affiliate is for you. Eventually youll become absolutely adequate with the actuality that computers amount from aught first.

    On the adventure to acquirements such things, we will alpha with the program that humans are consistently accept to address first, the [ accost world] program.

    There are two altered means of autograph this program. One is for C and one is for C++. C compilers about will not be able to abridge the C++ version, but back this C program is aswell accurate C++, C++ compilers will be able to abridge it too.


    Hello, world! for C



     int main(void)


    Hello, world! for C++


     int main()



    These both do the exact aforementioned thing; they just book Hello, world! and exit.

    Explanation of C

    The first band includes the accepted ascribe achievement attack file. It gives you altered means you can do ascribe and output.

    The next band of accent is the int main(void), which defines area your program will alpha active at (you accept to alpha somewhere).

    The appearance the compiler which statements main() contains.



    The action printf() prints the argument Hello, world! (The f stands for formatted). The
is an escape arrangement acceptation new line. The argument is generally printed to the screen, but it is absolutely accessible that it will go about abroad if the user requests it (or if the computer is in some aberrant environment).

    return 0 exits the program with a acknowledgment amount of 0. This acknowledgment amount can be advantageous for debugging.

    Explanation of C++

    The first band includes the ascribe achievement streamed attack file.

    The next band is int main() which defines area your program will alpha active at (you accept to alpha somewhere).

    The appearance the compiler which statements main() contains.

    The item cout (stands for animate out) receives streamed output; it is advised streamed because it can accept assorted pieces of information. However, like alotof additional things in the accepted library, cout is in namespace std. Therefore, the prefix std:: is acclimated to accredit to it.

    WARNING: Non-standard compilers boss not abode the accepted library names for C++ in the std namespace, so if using the std namespace causes compiler errors, do not use it.


    If you plan to use C, you should use printf to book your text, but if you plan to use C++ all of the time, both are available. However, cout is adopted in C++. This C adaptation of this argument will use printf, while the C++ adaptation of this argument will use cout. If you plan to just use C++ you should still be acquainted of how to use printf, because some libraries that can be acclimated in C++ are accounting in C, and accordingly use the printf style.



Tags: program, world, contains, statements, start

 program, world, printf, start, standard, output, return, streamed, namespace, input, compilers, version, somewhere, compiler, , int main, statements main contains, compiler which statements, program will start, defines where your, int main void,

Share accost: Digg it!   Google Bookmarks   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Article In : Computers & Technology  -  Programming