- 博客(17)
- 资源 (11)
- 收藏
- 关注
原创 APUE2e之Exercise 16.3 Solution B
Code for client side is in Figure 16.14 in APUE2e, Page 568.To compile the program, check this post: posix thread相关函数的编译(undefined reference to `pthread_create’)/** * apue-chap16: ex
2012-09-28 04:50:05 996
原创 APUE2e之Exercise 16.3 Solution A
Below is the code for the server side. Code for client side is in Figure 16.14 in APUE2e, Page 568.To compile the program, check this post: posix thread相关函数的编译(undefined reference to `pthread_crea
2012-09-28 04:49:12 273
原创 APUE2e之Exercise 10.11
/** * apue-chap10: exercise10-11.c * * Description: TODO * * Created On: Mar 1, 2012 * * @author: Huang Zhu * * @email: zhuhuang.zp@gmail.com */ //Run under Ubuntu 10.04. sig_intr is n
2012-09-28 04:48:03 433
原创 APUE2e之Exercise 10.6 Solution C
Using Standard I/O Library to read and write the file. Rather than using signal function, I used sigaction. Thus don’t need to call TELL_WAIT in the for body./** * apue-chap10: exercise10-
2012-09-28 04:46:51 542
原创 APUE2e之Exercise 10.6 Solution B
Using Standard I/O Library to read and write the file./** * apue-chap10: exercise10-6b.c * * Description: Standard I/O Library * * Created On: Feb 16, 2012 * * @author: Huang Zhu *
2012-09-28 04:45:53 851
原创 APUE2e之Exercise 10.6 Solution A
Using File I/O to read and write the file./** * apue-chap10: exercise10-6a.c * * Description: FILE I/O * * Created On: Feb 15, 2012 * * @author: Huang Zhu * * @email: zhuhuang.zp@gm
2012-09-28 04:45:00 345
原创 APUE2e之signal function, signal handler, and signal mask on Ubuntu
When I was trying to run the program in Figure 10.23 in APUE2e using Ubuntu command line, after I typed Ctrl+C twice, the program terminated, which meant that the second SIGINT signal generated was no
2012-09-28 04:42:24 353
原创 APUE2e之Exercise 8.7
close-on-exec flag/* * exercise8-7.c * * Created on: Nov 11, 2011 * Author: zhuhuang */ #include #include #include #include int main(void){ DIR *dir; int filedes1, filede
2012-09-28 04:40:22 246
原创 APUE2e之Exercise 8.2
vfork v.s. fork/* * exercise8-2.c * * Created on: Nov 10, 2011 * Author: zhuhuang */ #include int glob = 6; int callvfork(void){ int var=88; pid_t pid; //compare the ru
2012-09-28 04:39:12 230
原创 APUE2e之Exercise 3.6
I was working exercise3.6 of APUE2e and the code was simple. But when I tried to use fgets and fputs to print out the file content, I got problems. Then I tried to figure out the reason. It turned out
2012-09-28 04:37:26 252
原创 APUE2e之Exercise 3.2
My implementation for APUE2e Exercise3.2: implement my own dup2 function that performs the same service as the dup2 function. Based on a little testing, it seems to work and behave as the provided d
2012-09-28 04:36:09 280
原创 C++之Access Label, Inheritance, and Friend
************Inheritance************Three modes of inheritance in C++: public, protected, private. For example: class D: public A, protected B, private C. (A, B, C, D are all class types)class
2012-09-28 04:07:25 275
原创 C语言之数组与指针
*******数组首元素的地址 vs 数组首地址*******/*a: bff0660ca+1: bff06610&a: bff0660c&a+1: bff06620*/int a[5] = {1,2,3,4,5};printf("a: %x\n", a); //address of first element in the arrayprintf("a+1
2012-09-28 03:57:19 725
原创 C语言之大小端模式
//little endian: the least significant byte at lowest address.//big-endian: the most significant byte at lowest address.int checkSystem(){ //union size is the largest size of its fields. And all
2012-09-28 03:56:20 789
原创 C语言之预处理
ANSI C预处理命令:#define, #undef, #include, #if, #else, #elif, #endif, #ifdef, #ifndef, #line, #error, #pragmaANSI C宏:_LINE_:表示正在编译的文件的行号_FILE_:表示在横在编译的文件的名字_DATE_:表示编译时刻的日期字符串,例如“25 De
2012-09-28 03:54:26 772
原创 C语言之各种符号
*****comment*****/**/这种习惯的注释不能嵌套。编译器会将注释部分剔除,但不是简单的删除,而是用空格代替原来的注释,比如int/*...*/i是合法的,但in/*...*/t i不合法。y = x/*p编译出错,编译器把/*当成一段注释的开始。y = x/ *p或y = x/(*p)正确。*****back slash***
2012-09-28 03:53:27 1188
原创 C语言之各种关键字
C语言32个关键字:auto, int, double, long, char, float, short, signed, unsigned, struct, union, enum, static, switch, case, default, break, register, const, volatile, typedef, extern, return, void, continue,
2012-09-28 03:50:38 763
Types and Programming Languages
2009-01-18
Spin Model Checker - The-Primer and Reference Manual
2009-01-18
Software Engineering - A Practioner's Approach 5th edition
2008-11-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人