(*p)++ vs *p++ in C – Which One Changes the Value?

(*p)++ and *p++ differ by nothing but a pair of parentheses — and they do completely different things. One increments the value the pointer targets; the other moves the pointer itself. This question from our C Programming Quiz App checks whether you know which is which, and the answer comes down to operator precedence. The …

2[a] in C – Why Backwards Array Indexing Compiles and Runs

2[a] looks like a typo that should never compile — the index and the array are backwards. Yet it compiles cleanly, runs, and prints a well-defined value. This question from our C Programming Quiz App is a favorite C interview curveball, and the explanation reveals what array subscripting actually is underneath. The Quiz Question int …

Void Pointer in C – Why *(int *)vp Works and *vp Fails

A void pointer is C’s “points at anything” type — it can hold the address of an int, a struct, or a buffer, but it deliberately forgets the type along the way. This question from our C Programming Quiz App tests the round trip: store an address in a void *, cast it back, dereference. …

Negative Array Index in C – When p[-1] Is Perfectly Legal

A negative array index looks illegal — surely p[-1] must be undefined behavior? Not necessarily. This question from our C Programming Quiz App catches people who memorized “negative index = bad” instead of the actual rule: what matters is where the resulting address lands, not the sign of the offset. The Quiz Question int arr[] …

*p = *q in C – Copying a Value Through Pointers, Explained

*p = *q looks like it does something to the pointers — but the stars mean both sides are dereferenced, so it copies a value from one variable to another. This question from our C Programming Quiz App is a precision test: do you know the difference between assigning pointers and assigning through pointers? The …

Char Pointer in C – Reading a String with *(s + 2)

A char pointer into a string works exactly like an int pointer into an array — except each step is one byte, one character. This question from our C Programming Quiz App asks what *(s + 2) reads out of “abc”. Getting it right means keeping two things straight: where a string pointer starts, and …