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);
Answer Posted / 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 View All Answers
What is dynamic dispatch in c++?
Explain b+ tree?
What are # preprocessor operator in c?
Here is a good puzzle: how do you write a program which produces its own source code as output?
Why pointers are used?
What is the right type to use for boolean values in c? Is there a standard type?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
Explain what is the difference between a string and an array?
What are the uses of a pointer?
How can you increase the size of a dynamically allocated array?
What are the advantages and disadvantages of a heap?
What is the difference between union and anonymous union?
Describe explain how arrays can be passed to a user defined function
Why can’t constant values be used to define an array’s initial size?
Which is better malloc or calloc?