Let\'s say we have following code:
int func(char str[], int len) {
// Don\'t return anything here.
}
int main() {
char str[] = \"Hello\";
int re
If no return statement appears in a function definition, control automatically returns to the calling function after the last statement of the called function is executed. In this case, the return value of the called function is undefined. If a return value is not required, declare the function to have void return type; otherwise, the default return type is int.
As mentioned above its undefined so finding root cause behind some random value as return will be useless.