Intrinsic functions
// static type name Function name (parameter table) // For example: Static int Fun (int A,int b)// means fun is an intrinsic function and cannot suppress other file calls // internal function is also called static function
External functions
// If you are defining a function, add the keyword extern to the leftmost side of the first // This function is an external function that can be called by other files extern int Fun (int A,int b)
If you omit extern when defining a function, the default is an external function.
How to use external functions specifically, the following example
//file1.c file 1#include <stdio.h>intMain () {extern voidEnter_string (Charstr[]); extern voidDelete_string (CharStr[],Charch); extern voidPrint_string (Charstr[]); Charc,str[ the]; Enter_string (str); scanf ("%c",&c); Delete_string (STR,C); Print_string (str); return 0;}//file2.c File 2voidEnter_string (Charstr[ the])//define an external function enter_string{gets (str); //enter a string into a character array}//file3.c File 3voidDelete_string (CharStr[],Charch) { inti,j; for(i=j=0; str[i]!=' /'; i++) if(str[i]!=ch) str[j++]=Str[i]; STR[J]=' /';}//file4.c file 4voidPrint_string (Charstr[]) {printf ("%s\n", str);}
intrinsic and external functions