首页 > 其他 > 详细

2.4 函数的声明与定义

时间:2015-05-14 13:52:55      阅读:146      评论:0      收藏:0      [点我收藏+]

函数可以先声明后定义,如下:

#include<iostream>
int show(int, int);//函数声明
int main(){
    int a = 1, b = 2, c;
    c = show(a, b);
    std::cout << c << std::endl;
}

//函数定义
int show(int a, int b){
    return a + b;
}

 

2.4 函数的声明与定义

原文:http://www.cnblogs.com/cplusplus-study/p/4503075.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!