I'm learning about dynamics data structure e.g. malloc function.
Why sometimes programmers use void* as a pointer parameter to (for example) dynamic variables of integers and chars? What are the differences?
What are the advantages?
            Asked
            
        
        
            Active
            
        
            Viewed 462 times
        
    2
            
            
        - 
                    @user1 Unclear questions that demonstrate no research effort are not worth the time spent editing them. They end up closed anyway. – Pascal Cuoq Oct 16 '15 at 05:05
1 Answers
5
            Every pointer type can be cast to void* safely. Generic functions that need to work with pointers of all sorts of objects, such as malloc and realloc can work only if they use void* in their interface.
 
    
    
        R Sahu
        
- 204,454
- 14
- 159
- 270
- 
                    2There is not much more you can add to that. A complete explanation in 2-sentences -- those are rare in the world. – David C. Rankin Oct 16 '15 at 05:08
- 
                    
 
    