- 博客(30)
- 收藏
- 关注
原创 发送队列
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-30 17:08:34 414
原创 3
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-29 21:07:48 136
原创 2
#include #include #include #include int ticket = 10;void *sell_ticket1(void){ while(1){if(ticket > 0){sleep(1);printf("sell ticket--> chool ticket:%d\n",--ticket);
2016-11-28 23:06:01 158
原创 线程
#include #include void *myThread1(void){ int i; for (i=0; i { printf("This is the 1st pthread,created by zieckey.\n"); sleep(1);//Let this thread to sleep 1
2016-11-27 22:00:06 184
原创 时间
#ifndef __TIME_T#define __TIME_T /* 避免重复定义 time_t */typedef long time_t; /* 时间值time_t 为长整型的别名*/#endif 既 然time_t实际上是长整型,到未来的某一天,从一个时间点(一般是1970年1月1日0时0分0秒)到那时的秒数(即日历时间)超出了
2016-11-26 22:56:00 222
原创 pipe2
#include #include #include #include #include #include #include #define FIFO "/tmp/myfifo"main(int argc,char** argv){int w_fd;int r_fd;char r_buf[100];char w_buf[100];in
2016-11-25 23:37:25 1214
原创 pipe
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-24 22:59:39 193
原创 。
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-23 23:07:48 186
原创 等待进程
#include #include #include #include #include void die(const char *msg){ perror(msg); exit(1);}void child2_do(){ printf("In child2: execute 'date'\n
2016-11-22 23:03:23 167
原创 信号
#include #include #include #include void myfunc(int sign){ if(sign == SIGINT) { printf("hello world!\n"); } if(sign == SIGQUIT) { printf("exit!
2016-11-21 23:02:43 260
原创 进程
#include #include #include #include #include void die(const char *msg){ perror(msg); exit(1);}void child2_do(){ printf("In child2: execute 'date'\n
2016-11-20 21:41:51 146
原创 错误表示
errno.h EPERM /* Operation not permitted */操作不允许 ENOENT /* No such file or directory */文件/路径不存在 ESRCH /* No
2016-11-19 22:00:17 298
原创 database
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-18 23:07:11 255
原创 数据库2
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-17 21:44:41 153
原创 1
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-16 22:29:35 195
原创 文件
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-15 22:16:56 220
原创 顺序堆栈
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-14 21:50:17 373
原创 fgetc()相加
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-13 22:22:08 193
原创 双向链表
#include#includestruct dblnode{int num;struct dblnode *prior,*next;};typedef struct dblnode Dblnode;typedef struct dblnode* Dbllink;int is_malloc_ok(Dbllink *newnode){if((*ne
2016-11-12 22:30:33 173
原创 c
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-11 23:39:33 168
原创 带表头的循环链表
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-10 22:41:04 359
原创 双链表
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-09 22:52:44 179
原创 堆栈
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-08 23:04:25 165
原创 simp_link_head
/*****************************************************copyright (C), 2014-2015, Lighting Studio. Co., Ltd. File name:Author:Jerey_Jobs Version:0.1 Date: Description:Funcion List:
2016-11-07 23:00:11 218
原创 simp_link
//j简单单向链表#include #include struct node{int num;struct node * next;};typedef struct node Node;typedef struct node * Link;void create_link(Link * head){*head = NULL;
2016-11-06 20:51:23 369
原创 将句子中的单词位置倒置,而不改变单词内部结构.
编写一个C函数,将”I am from shanghai ”倒置为”shanghai from am I”,及将句子中的单词位置倒置,而不改变单词内部结构.#include #include void daozhi(char *s){char temp;char *end = s;//统计每个单词的开头和结尾char *start = s;char *p = s;
2016-11-05 23:32:48 1896
原创 复杂的c声明
介绍 曾经碰到过让你迷惑不解、类似于int * (* (*fp1) (int) ) [10];这样的变量声明吗?本文将由易到难,一步一步教会你如何理解这种复杂的 C/C++声明:我们将从每天都能碰到的较简单的声明入手,然后逐步加入const修饰符和typedef,还有函数指针,最后介绍一个能够让你准确地 理解任何C/C++声明的“右左法则”。需要强调一下的是,复杂的C/C
2016-11-04 22:59:01 193
原创 c常见错误
11.error C2017: illegal escape sequence中文对照:转义字符非法 分析:一般是转义字符位于 ' ' 或 " " 之外,例如“char error = ' '\n;” 12. error C2018: unknown character '0xhh'中文对照:未知的字符0xhh 分析:一般是输入了中文标点符号,例如“ch
2016-11-03 23:07:34 542
原创 常见的c语言错误
1.fatal error C1004: unexpected end of file found中文对照:文件未结束 分析:一个函数或者一个结构定义缺少“}”、或者在一个函数调用或表达式中括号没有配对出现、或者注释符“”不完整等 2. fatal error C1083: Cannot open include file: 'xxx': No such fi
2016-11-02 23:20:35 1921
原创 位运算
1.按位与 &用途:取(或保留)一个数的某些位,其余位置为0移位操作 :mask = 0xf 清零操作 :mask = ~(0xf 2.按位或 |用途:将一个数的某些位置置1 ,其余各位不变0xf )3.按位异或^用途 :使一个数的某些位置翻转或者取反(原来的1变为0 ,原来的0变为1),其余位不变交换a和b的值的方法: 1) a = a^b; b=a^b; a
2016-11-01 22:35:20 190
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人