运行 ❯
获取
自己的
网站
×
更改定位
更改主题,深色/浅色
转到 Spaces
#include <iostream> #include <string> using namespace std; int main() { string food = "Pizza"; // Variable declaration string* ptr = &food; // Pointer declaration // Reference: Output the memory address of food with the pointer cout << ptr << "\n"; // Dereference: Output the value of food with the pointer cout << *ptr << "\n"; return 0; }
0x6dfed4
披萨