← Back to archive

Stdle #179 · pointers · 2026-12-02

What does this C snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

#include <stdio.h>
void setTo(int **pp, int *target) {
*pp = target;
}
int main(void) {
int a = 1, b = 2;
int *p = &a;
setTo(&p, &b);
printf("%d\n", *p);
return 0;
}
Pointers
4 attempts left

Answer & explanation