1. Download the English Dictionary of Computer terminology
I'm under the European dictionary.
2. Registered Code Cloud GITOSC account
wcy947
3. Code
/*define an array containing 10 integers and initialize it, define a pointer variable p,p point to array A, define the function fun, require access to the array within the fun, and print the values of each element in the group, requiring that the number in the fun function not appear*/#include<stdio.h>intMain () {intarr[Ten] = {1,2,3,4,5,6,7,8,9,Ten}; int*p; P= arr;//Pointer to the first address of the array intm =Ten;//defining global Variables M intFunint*p,intm);//declaring functionsFun (p,m);//calling Functions}intFunint*p,intm) {//defining a fun function parameter is a pointer and shaping variable inti; for(i=0; i<m;i++) {//loop output, M is a global variableprintf"%d\n", *p+i); /*printf ("%d", *p); The second for the output *p+=1; */}}
4. Running Results
1
2
3
4
5
6
7
8
9
10
--------------------------------
Process exited after 0.4907 seconds with return value 10
Please press any key to continue ...
5. Summary:
1) at the beginning of the fun function to change the for loop condition to <=9, but feel not special low so defined global variables;
2) There are fewer problems, programming a bit of thinking, *p+i the position of a thought for a while, feeling or unfamiliar;
3) git that thing is disgusting, and for a long time, (still not very clear);
4) A lot of places programming more ideas will have.
git+ code cloud; Define the function fun and access the array inside the fun.