Why are pointers to a reference illegal in C++?

前端 未结 5 1759
悲&欢浪女
悲&欢浪女 2020-12-04 14:50

As the title itself mentions - why are pointer to a reference illegal, while the reverse is legal in C++?

5条回答
  •  孤街浪徒
    2020-12-04 14:59

    Suppose "int *&X" is legal, because reference is just another name of an object, the expression is equal to "int *X" and is not useful.

提交回复
热议问题