#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
//函数声明
//extern 返回值类型 函数名(参数列表) 关键字externa可以省略
//extern int add01(int a, int b);
int add01(int a, int b);//声明 就像是给一个程序的标准
int main()
{
//函数调用
int c = add01(10, 20);
printf("%d\n", c);
return 0;
}
//函数定义
//在一个项目中 函数的名字是唯一的
int add01(int a, int b)
{
return a + b;
}
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
void fun02()//子函数遇到return就是子函数停止然后返回主函数
{
printf("hello world\n");
//
exit(0);//终止程序
return;
printf("hello world\n");
return;
}
int main()//主函数遇到return就停止
{
printf("hello world\n");
fun02();
return 0;//与exit();效果一样
printf("hello world\n");
return -1;
}