#include <time.h> int main(int argc, char *argv[]) { time_t tp; char *str; time(&tp); ////////////appear error str=ctime(&tp); } ERROR: main.c:37: called object is not a function ,why ? 如果调用gettimeofday函数的话,得到的时间为struct timeval 形式的,不知道该怎么转换成一般的字符串形式?
by lrh_0_2000 - C/C++ - 2006-06-02 05:04:40 阅读(7061) 回复(9)
[color="#000000"]自定义的函数: [color="#990000"]函数执行: 实例: 取得IP所对应的DNS名称 (IP -> FQDN) [color="#000000"]$host= gethost($ip); echo "hostname: $host"; ?> 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/28922/showart_345382.html
计时器 睡眠函数 unsigned int sleep(unsigned int seconds); 例: #include XXXX int main() { time_t dt; time(&dt); printf("%s begin at:%s\n",__FILE__,ctime(&dt)); puts("sleep for 5 seconds...."); sleep(5); time(&dt); printf("%s end at:%s\n",__FILE__,ctime(&dt)); return 0; } 管道 创建管道 int pipe(int fd[2]); fd[0]用于读 fd[1]用于写 例: int z; int fd[2]; if((z==pipe(&fd[0])))==-1) { perror("pipe"); exi...
I want to find /home/user/test/temp.txt . use find as followed: find -name temp.txt -print //error why?
String reverse(String arg) { if(arg.length == 0) { return arg; } else { return reverse(arg.substring(1, arg.length)) + arg.substring(0,1); }} 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/29993/showart_384406.html
刚开始学习驱动编写。 在insmod 模块的时候,报出 QM_MODULES:function NOT IMPLEMENTED 同时在自己建的2.4.18内核的LFS系统下报出 couldn't find the kernel version the module was compiled for. 希望高手帮我解释一下,报错的原因。