作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
为什么 GCC 给我这个错误?我在这里做错了什么?
temp.c: In function main:
temp.c:6: error: invalid operands to binary +
代码:
main()
{
char *Address1,*Address2,*NewAddress;
Address1= (char*)0x12;
Address2= (char*)0x34;
NewAddress = Address1+Address2;
}
最佳答案
为什么要这样做?
C语言禁止两个指针相加。它只定义(有严格限制)指针和整数的加法。
基本上,您只能向指针添加一个足够小的整数,以便结果位于某个已分配内存区域的内部或结束边界处。
关于c - 海湾合作委员会错误 : Invalid operands to binary +,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8579467/
我是一名优秀的程序员,十分优秀!