易截截图软件、单文件、免安装、纯绿色、仅160KB

标准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++的专利 --- 这都不知道, 汗~~~


相关文档:

fork compare to exec in linux c program

pid_t  pid=fork()
it has 3 situation for the return result pid
0  child
>0 parent process
<0 fork fail
fork create a new process  and it parent live alse when the child process had been created ......

c/c++输出汉字

1. 使用TCHAR类型,定义在tchar.h中
#include <tchar.h>
#include <stdio.h>
int main()
{
 TCHAR s[] = "你";
 printf("%s \n",s);
 return 0;
}
2.关于C++中文字符的处理
 
一 引入问题
代码 wchar_t a[3]=L”中国”,编译时出错,出错信息为:数组越界。但wchar_ ......

Linux C 实现线程池

最近做的一些工作需要用到线程池技术,因此参考了一些资料和书籍,如《0bug c/c++商用工程之道》。
为此在linux平台上用纯c写了一个线程池的实现。
在此列出了原代码。
主要用到的数据结构有
1.struct  thread_pool_t    // thread pool 的实现代码
2.struct thread_pool_token_t  &nb ......

操作系统学习笔记(14) C和汇编相互调用

; 编译链接方法
; (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 ......

Linux下C语言实现字符串子串替换


    由于LINUX
C没有对字符串子串替换功能,所以我自己写了一个str_replace函数,实现了字符串替换.
请大家参考.
/*
 * FUNCTION     : str_replace
 *
ABSTRACT     : replace child string in a string.
 *
PARAMETER  &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号