Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Spot the bug
/
C++
/
C pointers
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
Copy
const
int
*
last_reading
(
void
) {
int
reading
=
42
;
return
&
reading;
}
Reveal
Copy code
Open in playground
Ask AI about this kata
Report an error
previous kata
Review a generated pointer-range search
Review AI code
A new version is available
Reload