by Barry Schwarz <schwarzb@[EMAIL PROTECTED]
>
Jul 10, 2008 at 06:32 PM
On Thu, 10 Jul 2008 15:46:21 -0700 (PDT), BrightColoredCandy
<backrub05@[EMAIL PROTECTED]
> wrote:
>I'm a beginner and just learning C++ and I'm a bit puzzled. I
>understand the literal meaning of void return is to return nothing but
>I don't understand the purpose by when a main function or a calling
>function calls a function when the return type of the called function
>returns void type. Why would you call it in the first place if it
>adds no value to the main function? I thought the whole idea when you
>call a function is to have a value returned to the main function or
>calling function. But if the return value is void it's as if there is
>literally no function to the called function. What am I missing
>because the books I've been looking at don't explain this. Can
>somebody give me an example of why void return is used?
Some languages restrict the word function to processes that return a
value and use the word procedure for those that don't. C and C++
don't.
Consider a function like qsort. Everything you want it to do is done
to the array in the argument list. There is nothing to return.
What would you like srand to return after it primes the random number
generator (and do you think anyone would ever check the return value)?
Some functions don't even return, like exit and abort.
Remove del for email