console window showing weird numbers. picture included

anyone know why this is happening? not sure what to type on google.. and the google results isn't the answer I'm looking for.

http://s15.postimg.org/ww0ss3e5n/weird_numbers.jpg


fix:
1
2
cout << jon();
jon();

What happens:
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
thanks for the advice.
Also... since jon() doesn't return anything, it probably should return void instead of int
Topic archived. No new replies allowed.