extern “C”的作用
- 1.指明函数是C函数
C++支持函数重载,因此编译器编译函数的过程中会根据函数的名字和参数类型支持函数重载
C语言不支持函数重载,编译C语言函数时函数名就足够了
通过externc,C++编译器就知道此函数是C函数了,会只使用函数名,链接的时候就可以找到C函数了 - 2.C头文件加上如下宏,C库可以正常编译,C库在C++项目中也可以使用了
1 | #ifdef __cplusplus |
usage: git clean [-d] [-f] [-i] [-n] [-q] [-e
-q, --quiet do not print names of files removed
-n, --dry-run dry run
-f, --force force
-i, --interactive interactive cleaning
-d remove whole directories
-e, --exclude <pattern>
add <pattern> to ignore rules
-x remove ignored files, too
-X remove only ignored files