What Can Function Prototypes Do Without Parameters and Return Values?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
Luongo
Messages
119
Reaction score
0
Just some basic questions i have about function prototypes (functions)
What's an example of a code which has no parameters? ie: double func(void)
what is the purpose if the thing doesn't take in parameters? also, what if there is keyboard input and screen input what does that mean in the function prototype? does it usually happen? what's the point of having a function if it doesn't RETURN any useful stuff to main? or prints nothing on the screen?
 
Physics news on Phys.org
A function can still do lots of things, even without parameters and returning a value. It will execute whatever code is in the function.

In this way it's basically a Procedure.