相关疑难解决方法(0)

使用具有相同声明的类方法调用全局函数

我想在C++类中包装一个C库.对于我的C++类,我也希望这些C函数使用相同的声明:是否可以这样做?

例如,如果我有以下情况,如何区分C函数和C++函数?我想打电话给C一个.

 extern int my_foo( int val ); //

 class MyClass{
    public:
    int my_foo( int val ){
           // what to write here to use
           // the C functions?
           // If I call my_foo(val) it will call
           // the class function not the global one
    }
 }
Run Code Online (Sandbox Code Playgroud)

c++ gcc word-wrap

32
推荐指数
3
解决办法
1万
查看次数

标签 统计

c++ ×1

gcc ×1

word-wrap ×1