int main() { int *r2; void abc(int **); abc(&r2); printf("%d",*r2); } void abc(int **r3) { int r1=5; /* add statements here */ }
Which statement is added to the above program such that the address of r1 gets stored in r2?
A) *r2 = &r1;
B)*r1 = &r3;
C) *r3 = &r1;
D) None of these
Answer C) here
but
void abc(int **);
this line inside main() is not needed
int main() { int *r2; void abc(int **); abc(&r2); printf("%d",*r2); } void abc(int **r3) { Static int r1=5; *r3 = &r1; }
Program should be like this, if address of r1 gets stored in r2 .
And if it is int r1 =5; then for this particular question , we can go with ans D right ?
64.3k questions
77.9k answers
244k comments
80.0k users