ProgrammingHardProduct-company MCQ pattern

Which of a, b, c, d are pointers?

Which of a, b, c, d are pointers?
#define IPTR int*
typedef int* IPT;
IPTR a, b;
IPT c, d;
  1. A. a and c only
  2. B. a, c and d
  3. C. c and d only
  4. D. All four

Correct answer: B. a, c and d

The macro is plain text: IPTR a, b; becomes int* a, b; and the * binds only to a, so b is an int. A typedef names a real type, so IPT c, d; makes both c and d pointers.

More C Programming questions

Exams that ask this topic