标准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++的专利 --- 这都不知道, 汗~~~
相关文档:
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 ......
在制定标准时,
C89
委员会关注下列几个原则,这些原则直到今天还在指导我们考虑问题。最重要的几个原则如下:
现存代码很重要,而现存的
C
编译器实现并不重要。
C
代码能够是可移植的。
C
代码可以是不可移植的。
C89
委员会不希望阻止
C
程序员写机器专用代码,因为这是
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 ......
extern "C"
extern "C"包含双重含义,其一:被它修饰的目标是“extern”的;其二:被它修饰的目标是“C”的。
1)被extern “C”限定的函数或变量是extern类型的;
extern是C/C++语言中表明函数和全局变量作用范围(可见性)的关键字,该关键字告诉编译器,其声明的函 ......
#i nclude <stdio.h>
#i nclude <dos.h>
#i nclude <conio.h>
#i nclude <graphics.h>
#i nclude <stdlib.h>
#ifdef __cplusplus
#define __CPPARGS ...
#else
#define __CPPARGS
#endif
#define MINBOXSIZE ......