函数声明

#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<math.h>

#include<time.h>

//如果定义在主函数上面就不需要声明;如果定义在主函数下面就需要声明

//函数声明:声明变量不需要建立存储空间;extern关键字可省略,可只需写返回值类型、函数名、函数的参数类型。int add(int ,int);

//一:1,函数定义  2,函数调用

//二:1,函数声明  2,函数调用  3,函数定义

extern int add(int a,int b);

int main()

{

  //函数调用

  int a=add(10,20);

  printf("%d ",a);

  return 0;

}

//函数定义 

int add(int a,int b)

{

  return a+b;

}

原文地址:https://www.cnblogs.com/wanghong19991213/p/13531140.html