A
Alfonzo Morra
I have some code as ff:
#define DEF_ONE 0.0112
#define DEF_TWO 0.25
typedef struct {
struct otherStruct *other ;
double this ;
double that ;
}myStruct ;
MyClass {
myStruct ms ;
public:
MyClass(){
&ms.other = NULL ;
ms.this = DEF_ONE ; //<- compiler barfs here
ms.that = DEF_TWO ; //<- compiler barfs here too ..
}
....
};
Is it not possible to assign #defines to variables (I'm sure I've done
this several times using C - many moons ago [granted C is not C++])
#define DEF_ONE 0.0112
#define DEF_TWO 0.25
typedef struct {
struct otherStruct *other ;
double this ;
double that ;
}myStruct ;
MyClass {
myStruct ms ;
public:
MyClass(){
&ms.other = NULL ;
ms.this = DEF_ONE ; //<- compiler barfs here
ms.that = DEF_TWO ; //<- compiler barfs here too ..
}
....
};
Is it not possible to assign #defines to variables (I'm sure I've done
this several times using C - many moons ago [granted C is not C++])