99问答网
所有问题
怎样消除警告c++ pointer of type void *'used in arithmetic
如题所述
举报该问题
推荐答案 2016-11-24
可以初始化,但是printf那句还需要写成*((int*)a)这样编译器才知道这个地方是需要用整形指针来求值。
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://99.wendadaohang.com/zd/Wjjvvt7vBjBzWzWOtvX.html
相似回答
有关C和
C++
中错误信息提示
答:
Type
mismatch in parameter 'YYYYYYYY' in call to 'YYYYYYYY'(调用'YYYYYYY'时参数'XXXXXXXX'数型不匹配)Type mismatch in redeclaration
of
'XXX' (重定义类型不匹配)Unable to creat output file 'XXXXXXXX.XXX' (不能创建输出文件'XXXXXXXX.XXX')Unable to create turboc.lnk (不能创建turboc.lnk )Unab...
...时显示
警告
initialization from incompatible
pointer
type
...
答:
或者定义一个指针 int (*p)[4] = num;int (*p2)[4] = num + 1;因为指针类型不一样的,你的int* p3=num[0]是只向一个具体的元素位置,而 int* p1=num,指向的是相当于一个内存块的位置, p1的类型和num是不一样的
c++
的常见错误
答:
英文 参考译文 Ambiguous operators need parentheses 模棱两可的操作符需要括号 Ambiguous symbol ''xxx'' 不明确的符号 Argument list syntax error 参数表语法错误 Array bounds missing 数组界限符丢失 Array size toolarge 数组尺寸太大 Bad character in paramenters 参数中有不适当...
C++
类型转换规则、何时发生隐式类型转换及强制类型转换适用场合_百度...
答:
例如,下面的程序使用 static_cast 找回存放在
void*
指针中的值: When we store a
pointer
in a void* and then
use
a static_cast to cast the pointer back to its original
type
, we are guaranteed that the pointer value is preserved. That is, the result
of
the cast will be equal to the ...
为什么运行
C++
老是有一个错误
答:
没代码说个毛线
编程c语言总是有一个错误
答:
执行 cl.exe 时出错这种错误一般是由于环境变量设置出错导致的,参见网上的各种教程 http://blog.csdn.net/hongloumengyan/article/details/6112272 实在不会就重装一遍,安装在默认路径里一般就不会有这个问题了
...1
of
`strlen' from incompatible
pointer
type
答:
int name[20];n = strlen(name);这两条语句有问题,strlen这个函数是用来处理字符串的,而你的name是int型数组,在VC中会error,DEV C会
警告
。把 int name[20]; 改为 char name[20]; 就可以了
C++
问题 错误 1 error C2084: 函数“int occurs(int [],int,int...
答:
76: Non-portable
pointer
conversion — 不可移动的指针(地址常数)转换77: Not a valid expression format
type
— 不合法的表达式格式78: Not an allowed type — 不允许使用的类型79: Numeric constant too large — 数值常太大80: Out
of
memory — 内存不够用81: Parameter xxx is never
used
— 能数...
C++
int类型参数的错误
答:
76: Non-portable
pointer
conversion — 不可移动的指针(地址常数)转换77: Not a valid expression format
type
— 不合法的表达式格式78: Not an allowed type — 不允许使用的类型79: Numeric constant too large — 数值常太大80: Out
of
memory — 内存不够用81: Parameter xxx is never
used
— 能数...
大家正在搜
pointerEventData
dangling pointer
cursor:pointer
urgent pointer
static void
i_pointer
int和void
pointer_1
2pointer
相关问题
C++问题,为什么提示错了。
C语言assignment makes pointer fr...
请问这句objective c++代码如何改正确?
C++ 【错误求帮改】构造函数、析构函数,delete等编程...
C++中typeid出现 expression must h...
C语言 `void*' is not a pointer-t...
C++指针问题,为什么要这样写:之前先定义一个指针 VOID...
C++ pointer