« February 2018 »
S M T W T F S
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28
You are not logged in. Log in
Entries by Topic
All topics  «
Output
Blog Tools
Edit your Blog
Build a Blog
RSS Feed
View Profile
Open Community
Post to this Blog
C++
Tuesday, 24 October 2006
C++
Topic: Output

                        Program #1 Output

1) #include <iostream.h>

2) int main(){

3)      cout<<"Hello World\n";

4)      return 0;

5)  } 

--------------------------------------------------------------------------------------

This tutorial will explian each line of code in a short but understandable manner.

Line 1: This line is called the include directive it is save on your hard drive as iostream.h. It tells the compiler that you will be accessing it for your program.

Line 2: For now what you should konw is - int main ()  is  the area of  the program  that is actually visible to the user.

Line 3: cout is a command we use from the directive in line 1. To print text to the screen a pair of double qoutes are use, with the actual text is in between the qoutes. the \n tells the computer to print a new line.

Line 4: This line is used by the compiler to check if the program ran successfully.

Line 5: Simply closes the { we had in line 1. The text between the {} is called the body. 


Posted by scristian at 7:28 PM EDT

Newer | Latest | Older