Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language on the conversion of plastic address to pointer
C language on the conversion of plastic address to pointer
I didn't look at the function carefully, but your question should have little to do with the function, it's all a conceptual problem.

1) has such a pass, and here & it is an address. You can imagine that the function needs to pass a pointer. What is in the pointer? Yes, it's the address, so of course it's right.

2) Look at these two sentences: printf ("sum of odd numbers:% d \ n", odd numbers);

Printf ("sum of even numbers: %d\n", even numbers);

Output the int variables odd and enen to the screen, how much odd is equal to, and the fun () function has been calculated, just this sentence * odd = o;; This sentence is to pay the value of o to *odd. Note that the * operator here is a value, which means to pay O to the value pointed by odd. Remember, the odd in the fun function is passed in as an address, and (* address) is the value that this address points to.

3) The above two points have been made very clear,&; Operator is to take the address, that is, to take out the address assigned to the variable odd in the int odd defined at the beginning of the main function. .