Suppose I want to write a function that takes a generic
pointer as an argument and I want to simulate passing it by
reference. Can I give the formal parameter type void **, and
do something like this?

void f(void **);
double *dp;
f((void **)&dp);



Suppose I want to write a function that takes a generic pointer as an argument and I want to simula..

Answer / shruti_kamthe

why **??

function that takes generic pointer argument.
declare pointer as void *

void f(void *);

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }

1 Answers  


sir, i cannot find the way how to write aprogram by using array on queue

1 Answers   IISIT,


HOW CAN ADD OUR FUNCTION IN LIBRARY.

5 Answers  


typedef struct { int i:8; char c:9; float f:20; }st_temp; int getdata(st_temp *stptr) { stptr->i = 99; return stptr->i; } main() { st_temp local; int i; local.c = 'v'; local.i = 9; local.f = 23.65; printf(" %d %c %f",local.i,local.c,local.f); i = getdata(&local); printf("\n %d",i); getch(); } why there there is an error during compiling the above program?

1 Answers  


What is a protocol in c?

0 Answers  






What is use of pointer?

0 Answers  


What is const and volatile in c?

0 Answers  


what does the following code do? fn(int n,int p,int r) { static int a=p; switch(n){ case 4:a+=a*r; case 3:a+=a*r; case 2:a+=a*r; case 1:a+=a*r; } } a.computes simple interest for one year b.computes amount on compound interest for 1 to 4 years c.computes simple interest for four year d.computes compound interst for 1 year

7 Answers   TCS,


When is an interface "good"?

1 Answers  


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

0 Answers  


What is the significance of c program algorithms?

0 Answers  


what will be maximum number of comparisons when number of elements are given?

0 Answers  


Categories