How to make generic function using void * in c?

后端 未结 7 2290
广开言路
广开言路 2020-12-13 07:48

I have an incr function to increment the value by 1 I want to make it generic,because I don\'t want to make different functions for the same functi

7条回答
  •  北海茫月
    2020-12-13 08:22

    You should cast your pointer to concrete type before dereferencing it. So you should also add code to pass what is the type of pointer variable.

提交回复
热议问题