Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 88

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 69

Answer:

In the following pgm add a stmt 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*/
}


Answer:
*k = &a


Explanation:
The argument of the function is a pointer to a pointer.

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 88 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: