GeekInterview.com
Series: Subject: Topic:
Question: 144 of 238

struct out {
struct in{ char c;int d;}s1,*p1;
}a1, *pa1;

pa1 = &a1;
a1.p1 = &s1;
Which is incorrect?
a. a1.p1->c
b. pa1->p1->c
c. a1->p1
d. a1.s1.c

This question is related to TCS Interview
Asked by: Interview Candidate | Asked on: Sep 21st, 2006
Showing Answers 1 - 3 of 3 Answers
Guest

Answered On : Sep 26th, 2006

option c is wrong i.e. a1->p1. Because a1 is not a pointer, you can not refer its member through -> operator.

Yes  1 User has rated as useful.
  
Login to rate this answer.
winny gupta

Answered On : Feb 15th, 2007

View all answers by winny gupta

c is the wrong option as a1 is not a pointer variable

  
Login to rate this answer.
naresh

Answered On : Feb 22nd, 2007

hi frns
the above one ans is c
because a1 can hold only the value of s1 but not its address value........
abd more over p1 cant be hold by a1 so the a1 cant become pointer to p1

  
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

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.