How to achieve function overloading in C?

前端 未结 14 2299
清歌不尽
清歌不尽 2020-11-22 03:16

Is there any way to achieve function overloading in C? I am looking at simple functions to be overloaded like

foo (int a)  
foo (char b)  
foo (float c , i         


        
14条回答
  •  花落未央
    2020-11-22 04:19

    There are few possibilities:

    1. printf style functions (type as an argument)
    2. opengl style functions (type in function name)
    3. c subset of c++ (if You can use a c++ compiler)

提交回复
热议问题