What does void function in C return?
c, function
Solution
A `void` function does not return anything. Your program invokes undefined behavior because it implicitly defines `m` to have return type `int` (in C89, if a function is called before it is declared, it's implicitly assumed to have return type `int`), but then defines it with return type `void`.
If you add a forward-declaration for `m`, the compiler will correctly complain that you're trying to use the return value of a void function, which is not possible.
Problem
``` #include <stdio.h> void main() { int k = m(); printf("%d", k); } void m() { printf("hello"); } ``` Output `hello5` What is the void function returning here? If there is no printf() then the output is `1`. What is happening here?