摘要:
数据在内存中的存储是按类型分配空间的,例如:int型变量一般分配四个字节,数据会存储在这四个字节中。同样的;数组的存储也是按照类型来的。 例如:int ar[10] = {1,2,3,}; 对于该数组来说,因为是int类型的数组,所以会占用40字节的空间,每4字节存储一个int类型元素。由此引出字符 阅读全文
posted @ 2019-10-09 16:10
crine
阅读(1681)
评论(0)
推荐(1)
摘要:
1、gettimeofday函数:获取到当前时间的秒数。 该函数的头文件在/usr/include/sys/time.h头文件中。 函数原型:int gettimeofday(struct timeval*tv, struct timezone *tz); 用到两个结构体: timeval 和 ti 阅读全文
posted @ 2019-10-09 13:44
crine
阅读(17474)
评论(0)
推荐(0)
摘要:
stat结构体 stat结构体原型在<sys/stat.h>中。因为有各种特殊数据类型,所以需<sys/types.h>头文件。struct stat { dev_t st_dev; /* ID of device containing file -文件所在设备的ID*/ ino_t st_ino; 阅读全文
posted @ 2019-10-09 11:59
crine
阅读(1347)
评论(0)
推荐(0)

浙公网安备 33010602011771号