In the following code, is p2 an integer or an integer pointer? typedef int* ptr ptr p1,p2;

Integer pointer


This question is related to Sonata Interview

Showing Answers 1 - 5 of 5 Answers

shrutimitra

  • Oct 23rd, 2005
 

An integer pointer. The typedef keyword is used to simply and create user defind datatype. Here we are creating user defined datatype int* as ptr.

  Was this answer useful?  Yes

kiran

  • May 21st, 2006
 

in the following code p2 is an integer .from the code , tht we r using typedef to define integer pointer as ptr. so the code looks like tis int* p1,p2; whic is equivalent to int *p1,p2;hence p2 is an integer pointer.

  Was this answer useful?  Yes

Tonni

  • Apr 7th, 2007
 

Integer pointer

typedef Is not the same as #define, meaning typedef does not make sure text is replaced before the compiler kicks in. It's a type definition, meaning everything declared as ptr will be 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