Home > Back-end >  The C language
The C language

Time:10-03

Inquire, I now want to encapsulate function, the C language how to put the for loop, all values of n call return the only one

CodePudding user response:

The problem is not too clear, best illustrate,
Generally can use pointer to return more than one parameter,

CodePudding user response:

I understand what you mean is to want to return to the multiple results of a for loop to a layer of function USES this simple, you define an array outside such as int arr [30], then the array to use as a function parameter, such as int for_func (int * p_arr), among them, the for_func () this function inside the for loop has been done, and pass p_arr the arr as actual parameters can, if it is not clear, baidu: C language array when the function parameters,

CodePudding user response:

Bool Func (STD: : list & Out);

CodePudding user response:

STD the standard library, there is also a version of the C language

CodePudding user response:

Can be defined as an array, the array of global also can be static, returns an array, and then directly, of course, also can be used in parameters,

CodePudding user response:

Thank you I done with array
  • Related