Question 1
Back to Exercise
What is the output of the following C program on a 64-bit system?
#include <stdio.h>
int main(void) {
int* a, b;
printf("%zu %zu\n", sizeof a, sizeof b);
return 0;
}
- A 8 4 Correct
- B 8 8
- C 4 4
- D 4 8
Correct Answer: Option A
The * belongs to the declarator a, not to the type. a is an int pointer (8 bytes) and b a plain int (4 bytes), however the spacing looks.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!