How to achieve function overloading in C?

前端 未结 14 2635
清歌不尽
清歌不尽 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:13

    Can't you just use C++ and not use all other C++ features except this one?

    If still no just strict C then I would recommend variadic functions instead.

提交回复
热议问题