Original Post
I''m having a simple problem. Its really simple and I''m sure every C programmer in the world knows the answer, but I don''t. I actually asked this question a while ago, but I didn''t ask it very well. I reduced the problem to a simple program. Basically: what''s wrong with the following program:
Main.cpp:
classa.h:
classa.cpp:
classb.h:
classb.cpp:
func.h:
func.cpp:
Thankx in advanced.
In my thunking device, what happens to the inherited pointer to the original base class when I override the function & how do I access it in my inline assembly code, assuming that we are referencing the higher byte of the 16-bit variable?
#include <iostream>
using namespace std;
#include "classa.h"
#include "classb.h"
#include "func.h"
int main()
{
a A;
b B;
cout << add(A,B);
return 0;
}
|
class a
{
public:
int A;
a();
};
|
#include "classa.h"
a::a()
{
A=5;
}
|
class b
{
public:
int B;
b();
};
|
#include "classb.h"
b::b()
{
B=1;
}
|
int add(a A, b B); |
#include "func.h"
int add(a A, b B)
{
return A.A+B.B;
}
|