GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Placement Papers  >  TCS  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 83 of 87    Print  
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

  
Total Answers and Comments: 3 Last Update: February 22, 2007     Asked by: diwakar 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by:
 
option c is wrong i.e. a1->p1. Because a1 is not a pointer, you can not refer its member through -> operator.

Above answer was rated as good by the following members:
ratneshict
September 26, 2006 08:05:44   #1  
       

RE: struct out {struct in{ char c;int d;}s1,*p1;...
option c is wrong i.e. a1->p1. Because a1 is not a pointer, you can not refer its member through -> operator.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
February 15, 2007 08:47:01   #2  
winny gupta Member Since: February 2007   Contribution: 8    

RE: struct out {struct in{ char c;int d;}s1,*p1;...
c is the wrong option as a1 is not a pointer variable
 
Is this answer useful? Yes | No
February 22, 2007 07:35:36   #3  
naresh        

RE: struct out {struct in{ char c;int d;}s1,*p1;...
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

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape