LearnFrenzy
Sign in Take a free test

Typedef · typedef MCQ · Question 5

#define PTR int * vs typedef with two variables Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 5 Back to Exercise

With #define PTR int *, what are a and b in PTR a, b;?

  • A Both int *
  • B a is int *, b is int Correct
  • C Both int
  • D a is int, b is int *
Correct Answer: Option B

The macro expands to int * a, b; and the * belongs only to a. With typedef int *PTR; both would be pointers.

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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links