c - "@far int* @near IntegerPointer;"的含义

标签 c memory pointers convention

我有以下定义。

far int* near IntegerPointer;

这是否意味着,放置在“near”内存中的指针指向放置在 far 内存区域中的整数。

谁能澄清一下。

最佳答案

是的,你没看错。

从右到左阅读声明(由内而外):

@far int* @near IntegerPointer;
                ^^^^^^^^^^^^^^

IntegerPointer 是一个

@far int* @near IntegerPointer;
          ^^^^^

IntegerPointer 是一个@near

@far int* @near IntegerPointer;
        ^

IntegerPointer 是一个@near 指针

@far int* @near IntegerPointer;
     ^^^

IntegerPointer 是一个@near 指针指向 int

@far int* @near IntegerPointer;
^^^^

IntegerPointer 是指向 int @far
的@near 指针 或者 IntegerPointer 是指向@far int 的@near 指针

不过,@near@far 是什么意思,我几乎不知道。

关于c - "@far int* @near IntegerPointer;"的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1555229/

相关文章:

使用scanf的C多维数组大小

c - scanf 需要多行输入

c - 递归和的大 O 运行时

c - 使用 strtok 的段错误

javascript - JavaScript 中的内存管理

c++ - 通过引用传递参数到底是什么?

Python多线程内存占用高的问题

eclipse - 发布需要大于默认 JVM 堆的 Eclipse 插件的最佳策略/实践?

c - 使用C返回数组

c++ - 在没有内存泄漏的情况下调整指针数组的大小