Judging from the problem, you don't seem to understand the concept of pointer. Pointer variables store the address in memory, and the actual data is put in this address.
According to this code, the pointer declared by int* points to an address in memory where an integer value is stored. So returning such a value is equivalent to returning a memory address. Therefore, there are two specific solutions in the program:
1. When the function is called, the pointer of the variable (that is, the memory address) is directly passed in as a parameter, and when the function is executed, the data at the corresponding address in the memory will be automatically manipulated. With this method, you don't need to return a value. Specific to this code, it is to declare int* tempA[ 10] in Main, declare foo function as void foo(int* A[ 10]), use foo(tempA) when calling, and directly use a[ 10] in foo function.
2. Take the memory address as the return value directly, because in C, the array name is a pointer to the first element of the array, so just return the array name directly, that is, return a ... if it is an ordinary variable, use the operator that accepts the memory address &; For example, if you declare the integer variable int i, you can return &; Me. This is the same as the usage in the printf function.
According to the supplementary content:
a-& gt; a 1->; i 1
|-& gt; a2->; i2
|……………………
|-& gt; Ann-> Imported?
This way of calling can only guarantee that a 1-an will not be modified. How to ensure that i 1-im will not be modified?
I hope the above answers can help you. PS。 I haven't used C for a long time. Please correct me if there are any mistakes.