Code AnalysisHard 180s
Dangling Pointer
Read the code and determine the output.
Starter code
int *f() {
int x = 42;
return &x;
}
int main() {
int *p = f();
printf("%s", p ? "ok" : "ub");
}Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.