MM creo no ser claro, este seria el codigo :
#include "iostream.h"
class LN
{
// Declaration of member variables
public:
char LNName[10];
char LNRef[30];
char Data[100];
struct {float ctVal,stVal,q,t;} Pos;
// Constructors and destructor
LN(){};
~LN(){};
};
class XCBR
{
// Declaration of member variables
public:
int b;
// Constructors and destructor
XCBR(){};
~XCBR(){};
};
class LD
{
// Declaration of member variables
public:
char LDName[30];
char LDRef[30];
char LogicalNode[100];
// This could be controled by an "if" sentence
//TVTR TVTR1, TVTR2, TVTR3;
//TCTR TCTR1, TCTR2, TCTR3, TCTR4;
LN *LN;
// Constructors and destructor
LD()
{
//LN = new XCBR;
}
;
~LD(){};
};
void main()
{
LD LD;
XCBR *temp = (XCBR*)LD.LN;
cout << temp->LNName << endl;
}
pero ahora con temp veo al atributo b de la clase XCBR pero no veo los atributos de LN, estoy equivocado?