11 2020 档案

摘要:(POSIX定时器) POSIX提供了一套定时器API,通过产生一个sigevent事件,来通知进程事件产生。 创建定时器 #include <signal.h> #include <time.h> int timer_create(clockid_t clockid, struct sigeven 阅读全文
posted @ 2020-11-29 21:34 Sigmun 阅读(988) 评论(0) 推荐(0)
摘要:#include <signal.h> union sigval { int sival_int; void *sival_ptr; }; struct sigevent { int sigev_notify; // 通知类型 int sigev_signo; // 通知信号 union sigva 阅读全文
posted @ 2020-11-29 21:01 Sigmun 阅读(232) 评论(0) 推荐(0)
摘要:字符串转换 C风格字符串 简单转换函数 #include <stdlib.h> int atoi(const char *str); long atoi(const char *str); long long atoll(const char *str); //(c99) 以上三个函数将str所指向 阅读全文
posted @ 2020-11-28 21:37 Sigmun 阅读(1088) 评论(0) 推荐(0)
摘要:类型推断 auto类型修饰符 在C++11以后,auto关键字能够用于类型推导。当声明语句中有初始化器时,auto能够根据对象的初始化器推断对象的数据类型。 例子: auto a = 123; // int auto b = 123l; // long auto c = 3.14; // doubl 阅读全文
posted @ 2020-11-06 15:04 Sigmun 阅读(158) 评论(0) 推荐(0)