The pointers in C++ primer

来源:互联网 发布:亚马逊关键词优化 编辑:程序博客网 时间:2024/06/05 10:02

What's the difference between the references and pointer?

the common:

they are used for indirect access to other objects.

the differences:

1.) a pointer is an object in itw own right. Pointers can be assigned and copied; a single pointer can pointer to several different objects over its lifetime.

2.) a pointer need not be initialized at the time it is defined. Like other built-in type, pointers defined at block scope have undefined value if they are not initialized.

TBD

0 0
原创粉丝点击