[Error]can‘t not convert int * to int
程序员文章站
2022-07-13 23:32:26
...
这句话的意思是不能把int *类型的变量转化为int类型的变量。
e.g
#include<stdio.h>
int main()
{
int *p;
int *q;
*p=q; //这一步出错:*p是int类型,q是int *类型,两者类型不同的话,是不能进行赋值运算的。
return 0;
}
这里为上述错误的那句赋值语句给出两种正确写法:
①
*p=*q //此时为int与int类型的变量的赋值运算
②
p=q //这是int*与int*类型的赋值运算
推荐阅读
-
连接Mysql错误 error 1042 can't get hostname for your address
-
vue - Error: Can't resolve '@/assets/img/github.svg (vue-cli3.0,无法解析.svg图片,已解决)
-
MYSQL ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.10.210' (111) 解决方法
-
MySQL错误 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 的解决办法
-
[ERROR] Can't start server: can't check PID filepath: No such file or directory
-
npm run dev 报错 ERROR in Entry module not found: Error: Can't resolve './src' in
-
解决com.alibaba.fastjson.JSONException: can not get javaBeanDeserializer. int
-
[Error]can‘t not convert int * to int
-
ERROR 1005: Can't create table ×××× (errno: 121)
-
连接Mysql错误 error 1042 can't get hostname for your address