first jon gets called and outputs line. Then main() tries to output result of jon() function which is never returned, so result is undefined: garbage value in this case.
BTW, your code should give you several warnings.
I cannot stress this enough: warnings are only one step away from error
. Read them and try to get rid of them.
Last edited on
Also... since jon() doesn't return anything, it probably should return
void instead of