GeekInterview.com
Series: Subject: Topic:
Question: 469 of 587

What is the type of the variable b in the following declaration?
#define FLOATPTR float*
FLOATPTR a,b;
a) float b) float pointer c) int d) int pointer

This question is related to Sonata Interview
Asked by: Interview Candidate | Asked on: Sep 9th, 2005
Showing Answers 1 - 8 of 8 Answers
spd

Answered On : Sep 9th, 2005

float * :p

  
Login to rate this answer.
nirupama

Answered On : Dec 28th, 2005

float

  
Login to rate this answer.
Vinnie

Answered On : Feb 20th, 2012

a) float is the right answer

  
Login to rate this answer.

a)float

  
Login to rate this answer.
neeraj

Answered On : Jul 16th, 2012

float

  
Login to rate this answer.

When the statement FLOATPTR a,b; is encountered, FLOATPTR is replaced by the macro expansion float * i.e the statement now becomes float * a,b;
So, b is a pointer to float.

  
Login to rate this answer.
jbode

Answered On : Oct 29th, 2012

View all answers by jbode

b is a plain float.

FLOATPTR a,b; expands to float* a,b;, which is *parsed* as float (*a),b;. The * is bound to the declarator, not the type specifier, so only a is declared as a pointer to float.

  
Login to rate this answer.
shivprasad

Answered On : Nov 2nd, 2012

b) float pointer

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.