摘要:
popen() 函数通过创建一个管道,调用 fork 产生一个子进程,执行一个 shell 以运行命令来开启一个进程。这个进程必须由 pclose() 函数关闭,而不是 fclose() 函数。pclose() 函数关闭标准 I/O 流,等待命令执行结束,然后返回 shell 的终止状态。如果 sh 阅读全文
摘要:
1 void hexdump(char *buf, int len) 2 { 3 int i = 0; 4 5 printf("\n----------------------hexdump------------------------\n"); 6 for(i = 0; i < len; i++) { 7 printf("%02x ... 阅读全文
摘要:
1. 字符串中移除一个字符 2. 字符串转为16进制整数 阅读全文