8.c Pointers
8.c Pointers
8. Pointers
Week : 8 Duration : 60 mins
52
‘C’ & ‘C’ only Sona Placement & Training Cell
53
‘C’ & ‘C’ only Sona Placement & Training Cell
printf(“%s”, obj->pName);
printf(“%s”, obj->pAddress);
}
a) Your Name, Your Address b) Your Address, Your Address
c) Your Name Your Name d) None of the above
54
‘C’ & ‘C’ only Sona Placement & Training Cell
55
‘C’ & ‘C’ only Sona Placement & Training Cell
56
‘C’ & ‘C’ only Sona Placement & Training Cell
57
‘C’ & ‘C’ only Sona Placement & Training Cell
int *p,*q;
p=&a[2][2][2];
*q=***a;
printf(“%d----%d”,*p,*q);
}
8. Assignment
58
‘C’ & ‘C’ only Sona Placement & Training Cell
59
‘C’ & ‘C’ only Sona Placement & Training Cell
60
‘C’ & ‘C’ only Sona Placement & Training Cell
ptr[1]=bbb;
ptr[2]=ccc;
ptr[2]();
}
36.In the following program add a statement in the function fun such that the address
of ‘a’ gets stored in ‘j’.
main()\
{ int * j;
void fun(int **);
fun(&j);
}
void fun(int **k)
{ int a =0;
/* add a stmt here*/ }
61
‘C’ & ‘C’ only Sona Placement & Training Cell
main()
{ int x=10,y=20;
swap(&x,&y);
printf(“x= %d y = %d\n”,x,y);
}
62