Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - A problem about pointers in c language.
A problem about pointers in c language.
/* The answer is 6, and the process is as follows */

# include & ltstdio.h & gt

Master ()

{ int a[]={2,4,6},* prt = & ampa[0],x=8,y,z; /* Define an integer array A, and store 2, 4 and 6 in the first three addresses of array A in turn.

Define an integer pointer prt, and assign the value of the first address in array A to

In the address pointed by prt */

for(y = 0; y & lt3; y++)

z =(*(PRT+y)& lt; x)? *(PRT+y):x; //Compare the value pointed by prt with x, and assign the smaller value to z;

printf("%d\n ",z); //print out the value of z.

}