is it possible to make function that will accept multiple data types for given argument?

前端 未结 4 655
广开言路
广开言路 2020-12-02 16:29

Writing a function I must declare input and output data types like this:

int my_function (int argument) {}

Is it possible to make such a de

4条回答
  •  旧巷少年郎
    2020-12-02 16:41

    read this tutorial, it gives some nice examples http://www.cplusplus.com/doc/tutorial/templates/

提交回复
热议问题