c++ scanf读取
Here, we have to input a valid memory address and print the value stored at memory address in C.
在这里,我们必须输入一个有效的内存地址并在C中打印存储在内存地址中的值。
To input and print a memory address, we use "%p" format specifier – which can be understood as "pointer format specifier".
要输入和打印内存地址,我们使用“%p”格式说明符-可以理解为“指针格式说明符” 。
Program:
程序:
In this program - first, we are declaring a variable named num and assigning any value in it. Since we cannot predict a valid memory address. So here, we will print the memory address of num and then, we will read it from the user and print its value.
在此程序中-首先,我们声明一个名为num的变量,并在其中分配任何值。 由于我们无法预测有效