Difference between void pointer and generic pointer? When a variable is declared as being a pointer to type void it is known as a generic pointer.
In this Java tutorial, you will learn How to Find Maximum Occurrence of Words from given Text File? Here is a logic for getting top element: Create a class. Scott, All but the Ruby implementation must be thrown to the trash immediately! Fibonacci is the perfect example of bad use of recursion: It doesn't scale at all. Since you cannot have a variable of type void, the pointer will not point to any data and therefore cannot be dereferenced. It is still a pointer though, to use it you just have to cast it to another kind of pointer first. Hence the term Generic pointer. This is very useful when you want a pointer to point to data of different types at different times. Here is some code using a void pointer: #include < stdio.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2017
Categories |