现在的位置: 首页 > 综合 > 正文

C++函数的基本知识

2019年01月05日 ⁄ 综合 ⁄ 共 242字 ⁄ 字号 评论关闭

使用C++函数必须完成如下工作:

1、提供函数的定义

2、提供函数的原型

3、调用函数

下面是一个函数调用的过程

#include <iostream>

using namespace std;
void simple();
int main(){
	cout<<"调用simple()函数开始"<<endl;
	simple();
	cout <<"调用simple()函数结束"<<endl; 
	return 0;
}

void simple(){
	cout <<"I'm but a the simple() function"<<endl;
}

抱歉!评论已关闭.