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

 Print  |  
Question:  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




September 09, 2006 08:05:44 #1
    Member Since: Visitor    Total Comments: N/A 

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.
     

 

Back To Question