|
|
|
|
 请教:汇编及C中---怎样调用C++类成员函数! - gotop167 [ 2005-04-28 12:11 | 723 byte(s)]
 Re: 请教:汇编及C中---怎样调用C++类成员函数! - cjhsh [ 2005-04-28 14:34 | 109 byte(s)]
 Re: 请教:汇编及C中---怎样调用C++类成员函数! - gotop167 [ 2005-04-29 12:18 | 12 byte(s)]
 Re: 请教:汇编及C中---怎样调用C++类成员函数! - adong [ 2005-04-28 12:59 | 121 byte(s)]
 Re: 请教:汇编及C中---怎样调用C++类成员函数! - gotop167 [ 2005-04-28 13:08 | 277 byte(s)]
 Re: 请教:汇编及C中---怎样调用C++类成员函数! - adong [ 2005-04-29 12:34 | 117 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
比如:
b.h
#ifndef _B_H_
#define _B_H_
class CB
{
public:
CB();
~CB();
int test(void);
private:
int val;
}
#endif
//////////////////////
b.cpp
CB::CB()
{
val = 100;
}
CB::~CB()
{}
int CB::test(void)
{return val;}
______________________________________________________________
a.c
#include "stdio.h"
int main(void){
int i; //请问在该C语言写的程序中,如何调用b.cpp中test成员函数!
return 0;
}
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
那汇编中如何做呢?
我想不出办法!因为C++函数编译后,加上很多只有编译器才认识的东西!
我用过extern "C"
这对于C++文件中普通函数是可以的!
但是对于C++类的成员函数就不行了!(编译都通不过)
谢谢!
|
|
|
[Original]
[Print]
[Top]
|
|
« Previous thread
有谁成功编译gcc-4.0 |
C/C++编程版
第34页 |
Next thread »
gcc 图形配置 |
|