What's the low-level difference between a pointer an a reference?

后端 未结 4 1975
悲哀的现实
悲哀的现实 2020-12-16 17:13

If we have this code:

int foo=100;
int& reference = foo;
int* pointer = &reference;

There\'s no actual binary difference in the ref

4条回答
  •  Happy的楠姐
    2020-12-16 17:44

    Pointers and references have different semantics in C++, but the code generated is the same.

提交回复
热议问题