Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102829186
hello.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 24, 15:11
Size
900 B
Mime Type
text/x-c
Expires
Wed, Feb 26, 15:11 (2 d)
Engine
blob
Format
Raw Data
Handle
24421225
Attached To
R7571 SP4E-TB-TL-FR
hello.cc
View Options
#include <cstdlib>
#include <iostream>
#include <typeinfo>
#include "series.hh"
/* -------------------------------------------------------------------------- */
int
main
(
int
argc
,
char
**
argv
)
{
// Hello N
std
::
cout
<<
"type of argc is: "
<<
typeid
(
argc
).
name
()
<<
std
::
endl
;
std
::
cout
<<
"type of argv is: "
<<
typeid
(
argv
).
name
()
<<
std
::
endl
;
std
::
cout
<<
"Number of inputs: "
<<
argc
-
1
<<
"
\n
"
;
int
n
;
if
(
argc
>
1
)
{
n
=
atoi
(
argv
[
1
]);
}
else
{
n
=
0
;
}
std
::
cout
<<
"Hello "
<<
n
<<
std
::
endl
;
// Print result from series (n operations necessary)
int
S
=
0
;
for
(
int
k
=
1
;
k
<
n
+
1
;
++
k
)
{
S
+=
k
;
}
std
::
cout
<<
"main: S"
<<
n
<<
" = "
<<
S
<<
"
\n
"
;
// Print result from serie using function
std
::
cout
<<
"computeSeries: S"
<<
n
<<
" = "
<<
computeSeries
(
n
)
<<
"
\n
"
;
return
EXIT_SUCCESS
;
}
Event Timeline
Log In to Comment