[x]
Ever Worried about Missed / Lost Mobile Phone (or) Mobile Phone Theft ?
Use GinGly to Save your Mobile Numbers and Useful Messages
Limited Time Free Access .Hurry Up !!!
Login
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Resend Activation Email
|
Forgot your Password?
Join IT Acumens Discussion Zone Free!
Welcome,
Guest
. Please
login
or
register
.
September 02, 2010, 11:35:23 PM
Home
Search
Team
Calendar
Gallery
Contact
Downloads
GoogleTagged
Login
Register
IT Acumens Discussion Zone
»
Tech News
»
Programming Discussions for Engineers
»
Programming Skills in "C++"
(Moderators:
VelMurugan
,
thiruvasagamani
) »
Structure and features of C++
« previous
next »
Reply
Print
Register to comment on this topic
Pages: [
1
]
Author
Topic: Structure and features of C++ (Read 419 times)
sukishan
Hero Member
Posts: 2918
Acumen
Structure and features of C++
«
on:
July 10, 2009, 09:45:24 PM »
Quote
Structure of the C++ Program and C++ features
Above program demonstrates several important features of C++ language. The structure of the program above is as follows:-
// This is my first C++ program
//It prints a line of text
are comments in C++ language.
# include <iostream>
is a preprocessor directive. It tells the preprocessor to include the contents of iostream header file in the program before compilation. This file is required for input output statements.
main Function
int main()
is a function. C++ program is a collection of functions. Every program in C++ begins executing at the function main(). Every C++ program has exactly one main function and a collection of other functions.
A function is the main entity where all of the functionality of a program is defined. A function takes some input, processes it according to the some code written in the function body and produces an output which can be either sent to the user or can be used by other functions.
Keyword int in int main()
specifies the return type of a function. int specifies that the function main returns an integer value.
Brackets () after main signify that main is a function. Every function should be followed by a pair of brackets. The purpose of brackets is to pass the parameters list to the functions. Parameters are the number and type of arguments (inputs) which a function takes.
Opening brace ( { ) and closing brace ( } ) mark the beginning and end of a function. Anything which is inside the braces is the body of that function.
In our example, the function body consists of only two statements,
{
std::cout << My first C++ program. \n;
return 0;
}
Logged
A good beginning makes a good ending
Reply
Print
Register to comment on this topic
Pages: [
1
]
« previous
next »
IT Acumens Discussion Zone
»
Tech News
»
Programming Discussions for Engineers
»
Programming Skills in "C++"
(Moderators:
VelMurugan
,
thiruvasagamani
) »
Structure and features of C++
GoogleTagged
structure
program
what