#include""和#include<>的区别

#include""和#include<>的区别在于,#include""预编译命令源程序在当前项目目录下寻找头文件,如果找不到,再到VC 6.0标准头文件目录下去找;而#include<>则直接告诉编译器直接去VC 6.0标准头文件目录下找头文件。
## 1 自定义命令 (1)编写自定义命令 > 1 编写自定义命令内容 > 2 注册指定命令 ```tcl /* *set up numbers sort command */ #include #include #include #include // numbers sort int NumSort(ClientData ClientData, Tcl_Interp *Interp, int objc, Tcl_Obj *const objv[]) { double arr[objc], tmp; char *pstr, *pstr2; char buf[100]; int cnt = 1, cnt2 = 0, i = 0; //1. string convert number,numbers sort for(cnt = 1; cnt 0; --cnt2) { if(tmp >= arr[cnt2 -1]) { arr[cnt2] = tmp; break; } else arr[cnt2] = arr[cnt2 -1]; } } } //2. numbers convert string and return for(cnt2 = 0; cnt2 注解: (1)初始化函数Init的名字必须是文件名首字母大写+"_Init",上文c文件名是numsort.c, 故初始化函数名为Numsort_Init; ## 2 编译生成动态库 (1) 格式: gcc -fPIC -shared ____.c -o lib____.so ``` $ gcc -fPIC -shared numsort.c -o libnumsort.so ``` > 注解: (1) ____.c 代表要进行编译的C文件名 (2)lib___是lib+C文件名,生成动态库的库名为lib__.so ## 3 加载动态库 (1) 格式: load libname ```tcl % load libnumsort.so ``` ## 4 调用自定义命令 (1) commondname args ```tcl % numsort 1 1.1 2 2.2 22 3.3 90 2.5 11.11 1 1.1 2 2.2 2.5 3.3 11.11 22 90 ``` ## 1 自定义命令 (1)编写自定义命令 > 1 编写自定义命令内容 > 2 注册指定命令 ```tcl /* *set up numbers sort command */ #include #include #include #include // numbers sort int NumSort(ClientData ClientData, Tcl_Interp *Interp, int objc, Tcl_Obj *const objv[]) { double arr[objc], tmp; char *pstr, *pstr2; char buf[100]; int cnt = 1, cnt2 = 0, i = 0; //1. string convert number,numbers sort for(cnt = 1; cnt 0; --cnt2) { if(tmp >= arr[cnt2 -1]) { arr[cnt2] = tmp; break; } else arr[cnt2] = arr[cnt2 -1]; } } } //2. numbers convert string and return for(cnt2 = 0; cnt2 注解: (1)初始化函数Init的名字必须是文件名首字母大写+"_Init",上文c文件名是numsort.c, 故初始化函数名为Numsort_Init; ## 2 编译生成动态库 (1) 格式: gcc -fPIC -shared ____.c -o lib____.so ``` $ gcc -fPIC -shared numsort.c -o libnumsort.so ``` > 注解: (1) ____.c 代表要进行编译的C文件名 (2)lib___是lib+C文件名,生成动态库的库名为lib__.so ## 3 加载动态库 (1) 格式: load libname ```tcl % load libnumsort.so ``` ## 4 调用自定义命令 (1) commondname args ```tcl % numsort 1 1.1 2 2.2 22 3.3 90 2.5 11.11 1 1.1 2 2.2 2.5 3.3 11.11 22 90 ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值