GATE CS 2016, set 1 · Question 22 · Programming and Data Structures · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Consider the following C program.
void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; __________ ; // call to f() }
Which one of the following expressions, when placed in the blank above, will NOT result in a type checking error?

  1. (A) f(s,*s)
  2. (B) i = f(i,s)
  3. (C) f(i,*s)
  4. (D) f(i,*p)
Answer

Answer (D)

Answer from the official GATE CS 2016 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes