摘要:源码目录hello-3.0/ src/ main.c lib/ hello.c hello.hsrc/main.c1 int main(void) {2 print_hello();3 return 0;4 }lib/hello.h1 #ifndef _HELLO_H2 #define _HELLO_H3 4 void print_hello();5 6 #endiflib/hello.c1 #include "hello.h"2 #include <stdio.h>3 4 voi...
阅读全文
摘要:linux Ctrl + DMSDos F6 或 Ctrl + Z 回车
阅读全文
摘要:1 #include "stdio.h" 2 #include "stdlib.h" 3 4 typedef int ElemType; 5 6 typedef struct node { 7 ElemType data; 8 struct node *next; 9 } *LNode, *LinkList; 10 11 // 初始化一个链表 12 LinkList 13 initLinkList(int n) { 14 LinkList list = NULL; 15 ElemType e; 16 LNode p,r; 17 ...
阅读全文
摘要:1 #include "stdio.h" 2 #include "stdlib.h" 3 4 #define MAXSIZE 10 5 6 typedef int ElemType; 7 typedef struct { 8 int *elem; 9 int length;10 int listsize;11 } Sqlist;12 13 // 初始化顺序表14 void15 initSqlist(Sqlist *L) {16 L->elem = (int *) malloc(MAXSIZE * sizeof(ElemType));17 if(!L
阅读全文
摘要:输出mysql版本1 #include <my_global.h>2 #include <mysql.h>3 #include <stdlib.h>4 #include <stdio.h>5 6 int main(int argc,char **argv) {7 printf("mysql client version:%s\n",mysql_get_client_info());8 return 0;9 }编译gcc version.c -o version $(mysql_config --cflags --libs)结果
阅读全文
摘要:静态库libdemo.h1 // libdemo.h2 #ifndef _LIBDEMO_H3 #define _LIBDEMO_H4 5 void demo_call(char *msg);6 7 #endiflibdemo.c1 // libdemo.c2 #include "libdemo.h"3 #include <stdio.h>4 5 void demo_call(char *msg)6 {7 printf("%s\n",msg);8 }编译库文件# 编辑成目标文件gcc -c libdemo.c -o libdemo.o# 创建
阅读全文