when I try the following code in visual studio it gives me 45 but when I run it in online compilers some give me an error and some give me 0.I was expecting that they all give me an error.how is that they are not?! thanks
#include <stdio.h>
int *f(int *a)
{
*a = 23;
int b = 45;
return &b;
}
int main(void)
{
int i = 2;
int *p;
p = f(&i);
printf("The return value of function f: %d\n\n", *p);
return 0;
}