Spot the bug in the local reading pointer

from C pointers
C23 (GCC 13.3.0) beginner 4 min 1 issue to find

Find the lifetime bug in this function.

C
const int *last_reading(void) {
    int reading = 42;
    return &reading;
}
Open in playground
Report an error