您的位置:首页 > 编程语言 > Qt开发

qt 如何调用c函数

2015-12-06 13:12 399 查看
many opensource code is in c code format for most wide use. qt uses c++.so use c function is the same as common C++ and C program.c functions and var to be called by c++ should be in a header file:
//cHeader.h
#ifdef __cplusplus
extern "C" {
#endif
void cFuncCalledByCPlus();extern int cVar;
#ifdef __cplusplus
}
#endif
in Cplus code, include "cHeader.h" and use functions and variables from c. So simple.
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: