#include int ∗addition(int a, int b){ int c = a + b ; int ∗d = &c ; return d ; } int main (void) { int result = ∗(addition(1, 2));
You're returning a pointer to a local variable, which gets deallocated after the function exits (and thus invokes undefined behavior).