如果 p 是一个指针,&p 是什么?
What does &p, if p is an pointer?
我有一个关于指针和地址的问题,我已经搜索了,但是没有找到信息。
int* p = new int;
*p = 5;
std::cout << p; // Output the address of p.
std::cout << *p; //Output the value pointed by p.
std::cout << &p; // Output a address, but what address is that?
如果p是指针,那么&p到底是什么?
&p
给出了指针p
的地址。
相关文章:
- 这个指针和内存代码打印是什么?我不知道是打印垃圾还是如何打印我需要的值
- 初始化或分配空字符串文字到指向 C 中的 char 的指针或指向 C++ 中 const char 的指针的原因是什么
- int数据类型的指针指向的是什么,如果是一个类的私有数据成员,我们创建了该类的两个对象?
- 使用基类指针调用基类的值构造函数的语法是什么?
- C++:Lambda 函数指针转换的用例是什么?
- C++关于指针和使用函数将它们启动到堆的行为究竟是什么?
- 使用共享指针时,从共享指针本身释放内存的机制是什么
- 为什么此指针值不能转换为整数的规则是什么?
- 在自定义 std::vector-like 容器中处理指针和非指针模板类型的最佳方法是什么?
- 回调和函数指针是什么关系
- 带有'this'的空指针是什么意思?
- 将对象传递给将创建它的函数时,要使用的合适的智能指针是什么
- 与自定义分配器一起使用的最佳唯一指针是什么
- 检测"内存泄漏"时,瓦尔格林德的真实指针是什么?
- 类指针*是什么意思
- 指向指针的指针是什么意思
- c语言中的远函数指针是什么,它的语法是什么
- 与指针向量一起使用的最佳智能指针是什么
- a=&*A 在 C++(其中 A 是指针)是什么意思?
- C++中的富指针是什么