ChinaUnix.net
相关文章推荐:

struct timeval

应用的需要,对一个时间进行修正,比如 struct timeval ori, dialt; 使用ori加上修正的dialt,应该怎么相加才能得出正确的结果?

by openq - C/C++ - 2008-02-22 23:05:30 阅读(3394) 回复(6)

相关讨论

是求得当前时钟相对于公元元年0时的秒数吗?

by dengcainiao - 内核/嵌入技术 - 2006-12-29 10:28:33 阅读(2623) 回复(3)

sco 上下面程序段编译出错: struct timeval timevalTimeout; timevalTimeout.tv_sec = 1; timevalTimeout.tv_usec = 0; err = select(sock + 1, &_fd_setRead, NULL, NULL, &timevalTimeout); 这一段编译时报: error: incomplete struct/union/enum timeval: timevalTimeout error: undefined struct/union member: tv_sec error: undefined struct/union member: tv_usec 何解???

by lifyman - C/C++ - 2004-12-28 16:53:38 阅读(2073) 回复(2)

timeval的长度是不是随系统差异而改变的呢 还是一律都是相同的长度 如果timeval溢出了会造成什么后果

by babyfrog - C/C++ - 2005-05-28 09:49:50 阅读(1380) 回复(2)

struct timespec struct itimerspec数据结构是怎样的,各个数据成员代表什么意义? 在哪里可以得到帮助文档? 谢谢各位解决小弟的问题

by xiaokousky - C/C++ - 2008-10-01 19:22:29 阅读(3958) 回复(1)

可以转么? 谢谢

by maxxfire - C/C++ - 2008-10-16 11:28:43 阅读(6148) 回复(3)

#include #include #include struct A { char v1; char v2; }; struct B { char v1; char v2; int v3; }; int main() { struct A a; struct B b; printf("a size is:%d\n",sizeof(a)); printf("int size is:%d\n",sizeof(int)); printf("b size is:%d\n",sizeof(b)); return 0; } [root@RedHat9 C]# gcc -o a.out test.c [root@RedHat9 C]# ./a.out a si...

by ming86506353 - C/C++ - 2008-12-06 16:38:59 阅读(1383) 回复(6)

typedef struct a { int i; long g; }; main() { a a0={10,20}; a p[2]={a0,a0}; ///???? } 为什么会有错啊?

by 3040602024 - C/C++ - 2007-04-10 21:41:17 阅读(1337) 回复(8)

$typedef struct{ char mtcom[16]; char minvno[11]; char mserno[16]; char mapnbr[16]; int mtvend; } TEMP; $TEMP sttemp; 其中的$是不是相当于EXEC SQL 这种是不是象C中struct

by yujun0512 - Informix - 2004-03-09 16:46:08 阅读(1143) 回复(3)

自己写了一个socket客户端,没有任何服务器端的情况下,用fcntl设置非阻塞的socket fd来connect,然后调用connect函数 然后用select函数来监视它 问题: 1. 这个select函数的参数timeval里面我设置了10秒的相应时间,但是程序运行到这里select就立即返回了。 2. 再调用getsockopt函数,optval的大小应该设为多大比较合适(我给了一个int),然后getsockopt的调用使得errno不为0,但是打印strerror确是Success。很奇怪。 源代码如下: ...

by jeanlove - C/C++ - 2009-05-15 16:07:04 阅读(10820) 回复(29)

c头文件里有如下定义: typedef unsigned int ub4; typedef unsigned short ub2; typedef unsigned char ub1; typedef struct _cluster_key { ub2 curc; ub2 comc; ub4 pk1; /*previous key occurence in the form */ ub2 pk2; ub4 nk1 ; /*next key occurence in the form */ ub2 nk2 ; } cluster_key_st; 我以为这个struct的长度为16个字节,结果printf("%d",sizeof(cluster_key_st))的结果是20。...

by virtualsafety - C/C++ - 2009-07-01 14:25:52 阅读(1945) 回复(5)