摘要:
// program 1-9 proc/shell2.c
#include "apue.h"
#include static void sig_int(int); /* our signal-catching function */ int main(void)
{ char buf[MAXLINE]; /* from apue.h */ pid_t pid;... 阅读全文
posted @ 2015-01-29 20:24
孙永杰
阅读(236)
评论(1)
推荐(0)
摘要:
// program 1-7 file/testerror.c#include "apue.h"#include int main(int argc, char *argv[]){ fprintf(stderr, "EACCES: %s\n", strerror(EACCES)); er... 阅读全文
posted @ 2015-01-29 19:28
孙永杰
阅读(165)
评论(0)
推荐(0)
摘要:
..... 阅读全文
posted @ 2015-01-29 18:38
孙永杰
阅读(186)
评论(0)
推荐(0)
摘要:
从标准输入读命令并执行 隐藏行号 复制代码 ? // program 1-5 proc/shell1.c // proc/shell1.c#include "apue.h"#include int main(void){ char buf[MAXLINE]; /* from apue.h */... 阅读全文
posted @ 2015-01-29 16:39
孙永杰
阅读(204)
评论(0)
推荐(0)
摘要:
// program 1-3 file/getcputc.c
#include "apue.h"
/*
The standard I/O functions provide a buffered interface to the unbuffered I/O
functions. Using standard I/O relieves us from having to choose optima... 阅读全文
posted @ 2015-01-29 14:50
孙永杰
阅读(265)
评论(0)
推荐(0)
摘要:
#include #include #ifdef __linux#include #endif// 编译器真是相当友好啊warning C4172: returning address of local// variable or temporary 一定不要返回局部变量啊char* GetMemo... 阅读全文
posted @ 2015-01-29 10:00
孙永杰
阅读(232)
评论(0)
推荐(0)
摘要:
#include #include #include #ifdef __linux#include #endif// COUNTING-SORT(A, B, k)// let C[0...k] be a new array// for i = 0 to k// C[i] = 0// for ... 阅读全文
posted @ 2015-01-29 09:08
孙永杰
阅读(196)
评论(0)
推荐(0)
摘要:
1 // program apue/file/ls1.c 2 #include "apue.h" 3 #include 4 5 int main(int argc, char* argv[]) 6 { 7 DIR* dp; 8 struct dirent* dirp; 9 10 if (argc != 2)
11 ... 阅读全文
posted @ 2015-01-29 08:40
孙永杰
阅读(200)
评论(0)
推荐(0)