current position:Home>*PTR is a value and a is a pointer. How can they be equal? Shouldn't it be * PTR = & A?

*PTR is a value and a is a pointer. How can they be equal? Shouldn't it be * PTR = & A?

2022-02-02 20:45:55 CSDN Q & A

img




Refer to the answer 1:

a Is an array name , One by one a Represents the address of the first element of the array , So it's right




Refer to the answer 2:



Refer to the answer 3:

When you look at pointer initialization, look like this : int* pr = a; pr It's a pointer , and int n = 5; Is the same form of initialization , int* It can be regarded as a variable type ( Useful, please adopt )




Refer to the answer 4:



Refer to the answer 5:

This is initialization , amount to
int *ptr;
ptr = a;




Refer to the answer 6:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022045532911.html

Random recommended