ProgrammingHardGATE CS · Campus placements
int (*p)[5]; What is sizeof *p / sizeof(int)?
- A. 1
- B. 10
- C. 5
- D. 20
Correct answer: C. 5
*p is an array of five ints, so its size is five times sizeof(int). The ratio is 5 on every platform.
More C Programming questions
- What does printf("%d", 7 % -3) print?
- int a = 7; printf("%d", a++ > 7); What is printed?
- For an int, what is the value of ~5 + 1?
- int x = 12; x = x ^ (x >> 2); What is x?
- Six people stand in a circle numbered 1 to 6; starting from 1, every second person is removed until one remains. Which number survives?…
- Seven people stand in a circle numbered 1 to 7. Starting from person 1, every third person is removed until one remains. Which number…