获取指针地址并对其执行操作

时间:2018-07-15 14:40:24

标签: c pointers heap-memory

struct Node
{
    int data;
    struct Node* npx;
};

struct Node* XOR (struct Node *a, struct Node *b)
{
    return (struct Node*) (a ^ b);
}

在上述XOR函数中,“ a”和“ b”是指针,这意味着“ a”和“ b”应按字面值给出地址。

  1. 为什么会失败,并显示“对二进制^无效的操作数”错误?
  2. 简单使用a的返回值是多少。如果uint32_t addr = a;

0 个答案:

没有答案