- 博客(56)
- 收藏
- 关注
原创 11302
#include #include #include //static int a=4;int a = 1;void *create(void *arg){ printf("new pthread ... \n"); printf("a=%d \n",a); return (void *)0;}int
2016-11-30 22:24:12 294
原创 11301
#include #include #include #include char message[]="hello world!\n";void * thread_function(void * arg){ printf("thread_function is running! argument is %s\n",(char *)arg);
2016-11-30 22:23:40 292
原创 11282
#include #include #include #include #include #include #define BUFFER_SIZE 2048int main(){ pid_t pid; int shmid; char *shm_addr; char flag[]="parent"; c
2016-11-28 22:51:13 315
原创 11281
#include #include #include #include #include #include #include #include #include #define PERM S_IRUSR|S_IWUSR/* 共享内存 */int main(int argc,char **argv) { int shmid; c
2016-11-28 22:50:48 276
原创 11272
#include #include #include #include #include #include #include #include struct msg_buf { int mtype; char data[255]; }; int main(){ key_t
2016-11-27 23:08:12 286
原创 11271
#include #include #include struct msg_buf { int mtype; char data[255]; }; int main(){ key_t key; int msgid; int ret; str
2016-11-27 23:07:45 521
原创 11262
struct operand{ int data[MAX]; int top;};struct operator_ch{ int top; char data[MAX];};typedef struct operand OPND;typedef struct operator_ch OPCH;v
2016-11-26 23:14:53 290
原创 11261
#define PERM S_IRUSR|S_IWUSR/* 共享内存 */int main(int argc,char **argv) { int shmid; char *p_addr,*c_addr; if(argc!=2) { fprintf(stderr,"Usage:%s\n\a",argv[0]); exit(1); }
2016-11-26 23:14:10 281
原创 11252
void initialization(){int i;getchar();printf("\n******************************************************\n");printf("1.停车--p 2.取车--g 3.停车时间--d 4.退出--E");printf("\n*****************
2016-11-26 00:11:20 314
原创 11251
void car_park(void){int x,i,j;printf("\n 欢迎您的光临! \n");printf("\n\n请输入车牌号:\n\n");printf("\n注意:车牌号要在1000至9999之间\n 输入错误的车牌号将返回主菜单\n\n");scanf("%d",&x); //输入要停车的号码for(i
2016-11-26 00:10:52 268
原创 11242
/*停车*/void Park(struct Garage gar[][6]){int i;char num[8];printf("请输入车牌号:");scanf("%s", num);
2016-11-24 23:14:32 344
原创 11241
/*给所有的车位的层号,车位号初始化,停车时间初始化为0,停车位全都初始化为空*/for (i=0; i<2; i++){for (j=0; j<6; j++){gar[i][j].lay = i+1;gar[i][j].garagenum = j+1;gar[i][j].time = 0;gar[i][j].isempty = 1;}}
2016-11-24 23:13:32 437
原创 11232
#include #include #include #include #include "shmdata.c"#include #define BUFFSIZE 2048int main(){ int running = 1; void *shm = NULL; struct shared_use_st * share
2016-11-23 22:11:37 281
原创 11231
#include #include #include #include #include "shmdata.c"#include int main(){ int running = 1; void *shm = NULL; struct shared_use_st * shared; int shmid;
2016-11-23 22:11:04 267
原创 11212
#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:48 269
原创 11211
#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-21 23:02:21 267
原创 11202
#define TEXT_SZ 2048struct shared_use_st{ int written; char text[TEXT_SZ];};
2016-11-20 22:35:52 232
原创 1121
#include #include #include #include #include #include #define BUFFER_SIZE 2048int main(){ pid_t pid; int shmid; char *shm_addr; char flag[]="parent"; c
2016-11-20 22:35:16 336
原创 11192
#include#include#include#includevoid create_table(sqlite3 *db); //创建表void insert_record(sqlite3 *db); //插入void contact_list(sqlite3 *db); //显示联系人void search_contact();void delete
2016-11-19 22:50:05 453
原创 11191
#include#include#include#includevoid create_table(sqlite3 *db); //创建表void insert_record(sqlite3 *db); //插入void contact_list(sqlite3 *db); //显示联系人void search_contact();void delete
2016-11-19 22:49:26 264
原创 11182
#include#include#include#includevoid create_table(sqlite3 *db); //创建表void insert_record(sqlite3 *db); //插入void contact_list(sqlite3 *db); //显示联系人void search_contact();void delete
2016-11-18 23:39:51 406
原创 11181
#include#include#includevoid add_person(); //添加联系人void del_person(); //删除联系人void research_person(); //查找联系人void show_all(); //显示所有联系人void repair_person(); //修改联系人信息void inter_
2016-11-18 23:39:13 263
原创 通讯录2.0
#include#include#includevoid add_person(); //添加联系人void del_person(); //删除联系人void research_person(); //查找联系人void show_all(); //显示所有联系人void repair_person(); //修改联系人信息void inter_
2016-11-17 22:38:26 278
原创 通讯录1.0
#include#include#includevoid add_person(); //添加联系人void del_person(); //删除联系人void research_person(); //查找联系人void show_all(); //显示所有联系人void repair_person(); //修改联系人信息void inter_
2016-11-17 22:38:04 220
原创 11162
#include #include#includetypedef struct node{ int num;struct node * next;}Node;typedef struct node * Link;void malloc_ok(Link * new_node){*new_node = (Link)malloc(
2016-11-16 23:02:35 362
原创 11161
#include #include#includetypedef struct node{ int num;struct node * next;}Node;typedef struct node * Link;void malloc_ok(Link * new_node){*new_node = (Link)malloc(
2016-11-16 23:01:29 303
原创 11152
#include #includestruct node{int num;struct node * next;};typedef struct node Node ;typedef struct node *Link ;void create_link(Link * head){*head=NULL;}void insert_node_hea
2016-11-15 23:39:25 293
原创 11151
#include #include struct node{int num;struct node * next;};typedef struct node Node;typedef struct node * Link;void create_link(Link * head){*head = NULL;}voi
2016-11-15 23:38:51 358
原创 11142
#include #include int main(){FILE *p1;FILE *p2;FILE *p3;char ch1,ch2,ch3;if((p3=fopen("3.txt","w+"))==NULL){perror("open error\n");exit(1);}if((p1=fopen("1.txt","r+"))==NULL)
2016-11-15 08:13:36 219
原创 11141
#include #include #include #include #include #include #include #include #define BUFFER_SIZE 10int read_line(int fd,char *buf,int count){int i;char ch;for(i=0;i{if((re
2016-11-15 08:12:55 533
原创 11132
#include #include #include int create_table(sqlite3 *db){char*errmsg = NULL;char *sql;sql="create table if not exists mytable(id integer primary key,name text);";if(SQLITE_OK != sq
2016-11-13 22:59:27 527
原创 11131
#include #include int main(){ FILE *p1,*p2,*p3;char ch1,ch2,ch3,chc;char a[2];if((p1 = fopen("text1.txt","r")) == NULL){perror("text1.txt");exit(-1);}if((p2 = fopen(
2016-11-13 22:53:31 612
原创 11122
#include #include int main(){FILE *from_fp;FILE *to_fp;char ch;if((from_fp=fopen("c1.txt","r+"))==NULL){printf("open error\n");exit(0);}if((to_fp=fopen("c2.txt","w+"))==NUL
2016-11-12 23:08:42 252
原创 11121
#include #include int main(){ FILE *p1,*p2,*p3;char ch1,ch2,ch3,chc;char a[2];if((p1 = fopen("text1.txt","r")) == NULL){perror("text1.txt");exit(-1);}if((p2 = fopen("tex
2016-11-12 23:04:03 196
原创 link_queue
#include #include #define max 10int rear = -1;typedef struct queue{ int num;struct queue * next;}Queue;typedef struct queue * Link;enum return_result{full_ok = 1000,
2016-11-11 21:48:07 293
原创 11111 lin_stack
#include #include typedef int datatype;typedef struct node{datatype data;struct node * next;}LinkStack;int StackEmpty(LinkStack *top){return(top?0:1);}datatype GetTop(L
2016-11-11 21:47:03 295
原创 11102
#include #include #define max 10typedef struct stack{int stack[max];int top;}Stack;enum return_result {full_ok,full_no,empty_ok,empty_no,push_ok,push_no,pop_ok,pop_no=-1};
2016-11-10 21:19:44 248
原创 11101
#include #include#includetypedef struct node{ int num;struct node * next;}Node;typedef struct node * Link;void malloc_ok(Link * new_node){*new_node = (Link)malloc(
2016-11-10 21:19:08 438
原创 1192
#include #include #define max 10typedef struct queue_seq{int a[max]; int rear;int front;}Queue;enum return_result {full_ok,full_no,empty_ok,empty_no,enqueue_ok,enqueue_no,de
2016-11-09 22:31:35 210
原创 1191
#include #include#includetypedef struct node{ int num;struct node * next;}Node;typedef struct node * Link;void create_link(Link * head){head = NULL;}void i
2016-11-09 22:31:07 229
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人