简体   繁体   English

如何读取使用指针获取的内存地址?

[英]How i can read memory address fetched using pointer?

I want to know what is this (0x6dfe80) memory address?我想知道这个(0x6dfe80)内存地址是什么? and how it can be useful in coding.以及它如何在编码中有用。 And if i fetched a memory address and how i can read it and estimate where is this memory location.如果我获取了一个内存地址以及如何读取它并估计这个内存位置在哪里。

  • what is meant by 0x? 0x 是什么意思?
  • what is meant by 6d? 6d是什么意思?
  • what is meant by fe? fe 是什么意思?
  • what is meant by 80? 80是什么意思?

or how this memory location is arranged?或者这个内存位置是如何安排的?

#include <iostream>

using namespace std;

int main(){

    int a,b,c;
    int* pointer_a; int* pointer_b; int* pointer_c;


    pointer_a = &a;
    pointer_b = &b;
    pointer_c = &c;

    cout<<"Address of variable a : "<<pointer_a<<endl;
    cout<<"Address of variable b : "<<pointer_b<<endl;
    cout<<"Address of variable c : "<<pointer_c<<endl;

    return (0);
}

代码

what is meant by 0x? 0x 是什么意思?

0x is a prefix that signifies a number in hexadecimal (which means 16) base (also called radix). 0x 是一个前缀,表示十六进制(即 16)基数(也称为基数)中的数字。 Addresses are conventionally serialised in hexadecimal.地址通常以十六进制序列化。

what is meant by 6d? 6d是什么意思? what is meant by fe? fe 是什么意思? what is meant by 80? 80是什么意思?

These are hexadecimal digits.这些是十六进制数字。 It is a number.它是一个数字。

and how it can be useful in coding.以及它如何在编码中有用。

Indirection has many uses.间接有很多用途。 For example, it can be used to implement a tree data structure.例如,它可以用于实现树数据结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM