Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
What is the advantage of a void pointer in C?
Home
Technology
What is the advantage of a void pointer in C?
asked
Jan 22, 2021
in
Technology
by
JackTerrance
What is the advantage of a void pointer in C?
interview-question-answer
technology-questions-answers
1
Answer
0
votes
answered
Jan 22, 2021
by
JackTerrance
There are following advantages of a void pointer in c.
Using the void pointer we can create a generic function that can take arguments of any data type. The memcpy and memmove library function are the best examples of the generic function, using these functions we can copy the data from the source to destination.
We know that void pointer can be converted to another data type that is the reason malloc, calloc or realloc library function return void *. Due to the void * these functions are used to allocate memory to any data type.
Using the void * we can create a generic linked list..
Related questions
0
votes
Q: What is the size of a void pointer in C?
What is the size of a void pointer in C?...
asked
Jan 21, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
+1
vote
Q: What is the advantage of declaring void pointers in C-Programming?
What is the advantage of declaring void pointers in C-Programming?...
asked
Nov 9, 2020
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Can math operations be performed on a void pointer?
Can math operations be performed on a void pointer?...
asked
Jan 22, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is (void*)0? Error re of null pointer re of void pointer none of the listed options?
What is (void*)0? Error re of null pointer re of void pointer none of the listed options? Select the correct answer from above options...
asked
Nov 30, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: What is the advantage of declaring void pointers?
What is the advantage of declaring void pointers?...
asked
Jan 17, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is void or Generic pointers in C?
What is void or Generic pointers in C?...
asked
Jan 21, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Which is a valid declaration within an interface? A)protected short stop = 23; b)final void madness(short stop); c)public boolean madness(long bow); d)static char madness(double duty);?
Which is a valid declaration within an interface? A)protected short stop = 23; b)final void madness(short stop); ... (double duty);? Select the correct answer from above options...
asked
Dec 1, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: What is Indirection and Increment/Decrement operators with a pointer in C?
What is Indirection and Increment/Decrement operators with a pointer in C?...
asked
Jan 24, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: How can we do Pointer comparison in C?
How can we do Pointer comparison in C?...
asked
Jan 24, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: How is a Program increment a pointer in C?
How is a Program increment a pointer in C?...
asked
Jan 24, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Which type of pointer is the most convenient way of storing the raw address in C programming?
Which type of pointer is the most convenient way of storing the raw address in C programming?...
asked
Jan 23, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is the use of a double pointer (pointer to pointer) in C?
What is the use of a double pointer (pointer to pointer) in C?...
asked
Jan 22, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: How to declare a pointer to a function in C?
How to declare a pointer to a function in C?...
asked
Jan 22, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is the usage of the NULL pointer in C?
What is the usage of the NULL pointer in C?...
asked
Jan 21, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is a near pointer in C?
What is a near pointer in C?...
asked
Jan 21, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
...