0x1004 on a typical system, not 0x1001. Pointer arithmetic is scaled by the size of the pointed-to type: p + n advances by n * sizeof(*p) bytes. For int * with 4-byte ints, +1 moves 4 bytes, one element. For a char * it would move 1 byte; for a struct * it moves sizeof(struct). This is why you always reason in elements, not bytes, and why casting a pointer to a different type before doing arithmetic changes the stride, a common source of buffer-walking bugs.
C Programming · Interview question
If p is an int * holding address 0x1000, what is p + 1?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
Pointer Arithmetic & Arrays
Why arr[i] is literally *(arr + i), how pointer math scales by type size, and the array-to-pointer decay that loses your size the moment you call a function.