previous
|
index
|
next
Testing Functions
A simple
main
function:
int
main
(
int
argc
,
char
**
argv
)
{
cout
<<
cylinderVolume
(
5
,
4
);
// output should be 314.159
}
main
is called for the side-effects it produces, not for what it returns
main
's return type is
int
so it can signal an error status
The formal arguments
argc
and
argv
are used for command line arguments and can be ignored for now
cout
is a symbolic name for standard output, i.e. the terminal screen
<<
is an operator for piping values to standard output
Anything beginning with
//
is a C++ comment and ignored to the end of the line
previous
|
index
|
next