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*/

}



In the following pgm add a stmt in the function fun such that the address of 'a�..

Answer / susie

Answer :

*k = &a

Explanation:

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

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Code Interview Questions

Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).

1 Answers  


write a program to find out roots of quadratic equation "x=-b+-(b^2-4ac0^-1/2/2a"

2 Answers  


#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }

1 Answers  


how to return a multiple value from a function?

5 Answers   Wipro,


main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

2 Answers   IBM,






main() { 41printf("%p",main); }8

1 Answers  


How we print the table of 2 using for loop in c programing?

14 Answers   HCL, Wipro,


Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.

1 Answers  


Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number

2 Answers   Ace Info,


main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. –3, -1, 1, 3, 5

2 Answers   HCL,


main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }

2 Answers  


What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }

1 Answers  


Categories