error: aggregate value used where an integer was expected
来源:互联网 发布:淘宝只能手机号注册吗 编辑:程序博客网 时间:2024/06/14 06:23
问题描述:
把struct结构体类型数据,强制转换成unsigned long
不能进行转换的原因是因为结构类型(包括 union)不是数量类型(Scalar Type);只有在数量类型之间才能进行转换。数量类型包括算术类型和指针类型,算术类型由包括整数类型和浮点类型。
哪怕是
struct
in_addr 类型:
struct in_addr { in_addr_t s_addr;};in_addr_t 一般为 32位的unsigned int,其字节顺序为网络顺序(network byte ordered),即该无符号整数采用大端字节序。这里即使内存中是unsigned int 类型的,也不能实际使用成unsigned int,因为整体类型不一样,c语言禁止强制转换,强制转换是'低级类型',转'高级类型';但是可以使用指针强制将这段内存解释成unsigned int类型的数据。即unsigned int a1 = *(unsigned int *)&(
(struct in_addr) a2);
0 0
- error: aggregate value used where an integer was expected
- Null value is eliminated by an aggregate or other SET operation and returned error code 0xC0202009
- ERROR:Terminal, but class was expected
- There was an internal error.
- Sys.ArgumentOutOfRangeException: Value must be an integer
- Sys.ArgumentOutOfRangeException: Value must be an integer.
- Sys.ArgumentOutOfRangeException: Value must be an integer.
- Sys.ArgumentOutOfRangeException: Value must be an integer
- Sys.ArgumentOutOfRangeException: Value must be an integer
- ERR hash value is not an integer
- error: Found tag String where item is expected
- an error was encountered while running arcsde
- There was an internal API error.
- There was an internal API error.
- There was an internal API error.
- There was an internal API error.
- error:include/asm is a directory but symlink was expected
- SQL Error:An aggregate may not appear in the set list of an UPDATE statement.
- GPU 编程入门到精通(一)之 CUDA 环境安装
- light oj--1008--(数学规律问题)
- malloc源码分析---2
- JAVA集合类
- 6、UIStepper基于swift的步进控件的使用
- error: aggregate value used where an integer was expected
- CCITT标准CRC-16计算C源代码
- cocos2d-js环境搭建
- HashMap集合中装入ArrayList集合
- 磁盘分区类型--文件系统标志 (详细英文资料)
- (七十一)关系表达式
- 图片显示错误url rewrite module error
- 一款App,从设计稿到切图(Android篇)
- Python 爬虫学习系列教程----目录