Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to define a function so that it returns an array
How to define a function so that it returns an array

The array name is actually a pointer, and you can return a pointer. For example:

int* fun(int a, int b) This is fine.

An alternative is to add an array to the input parameters and modify the array in the function. The contents of the array will also change after the function is run.