R
rudra
dear friends,
i am a novice C++ user; all my previous experience is with fortran.
newly i started learnning C and C++. and there is few question in my
mind. I consider to post my queries here, so that experienced ppl may
help me.
1. in every function that C uses including main(), we use "return
0" (stroustroup prefers to use the variable directly in case of
functions). whta is the significance of this "0"? i checked with
return 1 and still its working fine. SO WHAT 0 MEANS IN 'RETURN 0'
STATEMENT?
2. As my foundation in fortran,(and i guess a valid understanding in C+
+ as well), function do some work of the the code; say when you need
to calculate something again and again or a seperate calculation whose
result is to be used by the main program. keeping this in mind, i am
not getting any logic of void function, which by efination, **does
not** return any value to the main(). So why on earth the VOID
FUNCTION NEEDED?
this may be very primitive question, but i ll be really greatful if
you ans them.
regards
i am a novice C++ user; all my previous experience is with fortran.
newly i started learnning C and C++. and there is few question in my
mind. I consider to post my queries here, so that experienced ppl may
help me.
1. in every function that C uses including main(), we use "return
0" (stroustroup prefers to use the variable directly in case of
functions). whta is the significance of this "0"? i checked with
return 1 and still its working fine. SO WHAT 0 MEANS IN 'RETURN 0'
STATEMENT?
2. As my foundation in fortran,(and i guess a valid understanding in C+
+ as well), function do some work of the the code; say when you need
to calculate something again and again or a seperate calculation whose
result is to be used by the main program. keeping this in mind, i am
not getting any logic of void function, which by efination, **does
not** return any value to the main(). So why on earth the VOID
FUNCTION NEEDED?
this may be very primitive question, but i ll be really greatful if
you ans them.
regards