标准c(c89,c99)原来不支持缺省参数
编译一个图象接口库,其中用到cvSaveImage( out_img_name, img); 编译报错:
too few arguments to function cvSaveImage
一下子就糊涂了,从来都是这么用 cvSaveImage 的。highgui.h里的函数原型也是定义了缺省的,
CVAPI(int) cvSaveImage(const char* filename, const CvArr* image, const int* params CV_DEFAULT(0)
);
查了一下,原来缺省参数是 c++的专利 --- 这都不知道, 汗~~~
相关文档:
#include <iostream>
#include <conio.h>
using namespace std;
typedef struct _INTTEST
{
int a;
}inttest;
int main()
{
inttest* p=new inttest[3];
p[1].a=10;
cou ......
最近做的一些工作需要用到线程池技术,因此参考了一些资料和书籍,如《0bug c/c++商用工程之道》。
为此在linux平台上用纯c写了一个线程池的实现。
在此列出了原代码。
主要用到的数据结构有
1.struct thread_pool_t // thread pool 的实现代码
2.struct thread_pool_token_t &nb ......
; 编译链接方法
; (ld 的‘-s’选项意为“strip all”)
; gcc -c not link
;
; [root@XXX XXX]# nasm -f elf foo.asm -o foo.o
; [root@XXX XXX]# gcc -c bar.c -o bar.o
; [root@XXX XXX]# ld -s foo.o bar.o -o foobar
; [root@XXX XXX]# ./foobar
; the 2nd one
; [root@XXX XXX]#
exter ......