In the following code, what is p2? typedef int* ptr ptr p1, p2;

A) an integer

B) an integer pointer

C) a pointer

D) None of the above




Showing Answers 1 - 19 of 19 Answers

chandhi

  • Feb 12th, 2006
 

An integer pointer. C provides a facility for creating new data type names.

  Was this answer useful?  Yes

abhimanipal

  • Jan 28th, 2010
 

The answer is integer pointer. But the reason for this is not so apparent. When we write

typedef int* ptr        

We create a new type int* . So when we write

ptr p1, p2

The new type ptr is applied to both p1 and p2.
So p2 become an integer pointer

NOTE:
If we write int* p1,p2 in this case p2 is an integer. This is because the * is applied only to p1. To make my point clearer, I re write the above statement as

int *p1,p2

B.Padmashri

  • Sep 21st, 2014
 

B) an integer pointer

  Was this answer useful?  Yes

Dinesh

  • Nov 7th, 2015
 

B) an integer pointer

  Was this answer useful?  Yes

sanjeet kumar

  • Nov 12th, 2015
 

B) an integer pointer

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions