Home > Article > Backend Development > How to use fun function in C language?
How to use the fun function in C language
The fun function is usually called by the main function, and its role is to define a function or method , so that it can be represented by fun during reuse, such as "int fun(int x,int y)", "void fun(char* a, char* b)", etc.
#Note: There is no fun function in the C/C language standard library. The fun function is a custom function that is used for examples or syntax demonstrations. It needs to be defined and declared by itself before use. The word fun has no special meaning and can also be replaced by another name, such as "abc" or "baidubaike". It only means referencing the function that appeared before to call it to perform some requirements. int fun (int x, int y) is just an example of a function name and its declared parameter type.
Sample code
#include<stdio.h> void fun(int *p) { printf(%d\n",p[5]); } main() { int a[10]={1,2,3,4,5,6,7,8,9,10}; fun(&a[3]); }
Recommended tutorial: "C#"
The above is the detailed content of How to use fun function in C language?. For more information, please follow other related articles on the PHP Chinese website!