摘要: 创建守护进程 阅读全文
posted @ 2016-06-24 10:52 自由石匠 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 int main() 10 { 11 key_t key; 12 int shmid; 13 } 阅读全文
posted @ 2016-06-23 12:03 自由石匠 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 摘自 http://blog.chinaunix.net/uid-26565142-id-3051729.html 1,文件IO函数,在Unix中,有如下5个:open,read,write,lseek,close。称之为不带缓存的IO(unbuffered I/O)。不带缓存指的是每个read,w 阅读全文
posted @ 2016-06-18 11:05 自由石匠 阅读(642) 评论(0) 推荐(1) 编辑
摘要: 1 #include 2 #include 3 4 typedef int datatype; 5 typedef struct node/*链表的每一个节点都是结构体*/ 6 { 7 datatype data; 8 struct node *next; 9 }linklist;/*linklist 是struct node 的别名,... 阅读全文
posted @ 2016-06-15 09:25 自由石匠 阅读(237) 评论(0) 推荐(0) 编辑
摘要: /* * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * pu... 阅读全文
posted @ 2016-06-09 11:01 自由石匠 阅读(523) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #define debug 0 3 int main() 4 { 5 int a[3][4]={{8,2,6,4},{1,4,7,9}},i,j; 6 #if debug 7 a++; 8 a[0]++; 9 a[1]++; 10 a[2]++; 11 a 阅读全文
posted @ 2016-05-24 17:09 自由石匠 阅读(226) 评论(0) 推荐(0) 编辑
摘要: putchar输出一个字符,puts输出字符串。 阅读全文
posted @ 2016-05-24 11:23 自由石匠 阅读(685) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 int main() 3 { 4 int a = 20; 5 int b = 30; 6 const int *p = &a; 7 printf("*p = %d\n",*p); //20 8 9 a= 200; 10 printf("*p = %d\n",*p);//20 11 12 p= &b; 13 //*p = 300; 14 ... 阅读全文
posted @ 2016-05-23 16:57 自由石匠 阅读(126) 评论(0) 推荐(0) 编辑
摘要: break: break用于循环则是终止循环,break如果用于switch,则是用于终止switch。break不能直接用于if,除非if是属于循环内部的一个子句 在多层循环中,break只能终止最里面包裹它的那个循环 1 for (i=0;i<3;i++) 2 { 3 for (j=1;j<4; 阅读全文
posted @ 2016-05-22 15:54 自由石匠 阅读(546) 评论(0) 推荐(0) 编辑
摘要: C语言无I/O语句,i/o操作由函数实现 #include<stdio.h> 字符输出函数putchar: 格式:putchar(c) 参数:c为字符常量,变量或者表达式 功能:把字符c输出到显示器上 返回值:正常,为显示的代码值 格式输出函数printf 格式:printf("格式控制符",输出表 阅读全文
posted @ 2016-05-21 17:06 自由石匠 阅读(465) 评论(0) 推荐(0) 编辑