function overloading/ declare function
- Declare a function
To declare a function without identifying the argument list, you can do it in this way:
void say hello(...);
here, you use three point (...) to indicate that the function have no argument.
- function overloading
Keep in mind that the signature, not the function type, enables function overloading. For example, the following two declaration are incompatible:
long gronk (int n, float m); #1 //same signature
double gronk(int n, float m); #2 //hence not allowed
why, for example, if this is possible:
int hel=0;
float haa=3;
gronk(hel, haa); //which function to use, #1 or #2, it is conflict.
therefore, C++ doesn't allow you to overload gronk() in this fashion. You can have different return type, but only if the signature are also different, for example:
long gronk(int n, float m);
double gronk(double n, double m); //now it is allowed
最新文章
- 斯坦福第十九课:总结(Conclusion)
- jquery 获取元素坐标
- 如何进行Monkey Test
- socketpair的使用
- python之math模块
- wget ( download the whole page from the website )
- CEOI 2014 wall (最短路)
- java面试题—精选30道Java笔试题解答(二)
- jsp页面附件上传暂存的处理
- 在 .NET中,一种更方便操作配置项的方法
- VDSR
- map获取数字与int比较
- c#无边框窗体移动
- 360se打开慢,lsass 过高 , cpu温度上升
- .NET 证书加密 存储保存 IIS授权
- Confluence 6 为站点启用匿名用户访问
- 嵌套的ng-repeat双层循环,内层如何获取外层的$index?
- 【layer】关于layer打开就是最大化的使用
- HDOJ.1113 Word Amalgamation(map)
- Nginx 常用配置模板