This question shows research effort; it is useful and clear
1
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
为什么引用不能在 C++ 中重新初始化,而指针可以重新初始化?
int x=5;
int y=6;
int *p1;
p1 = &x;
p1 = &y; //re-initializing the pointer but same can not be done with references
int &r1 =x;//can be initialized only once