R
rene
Hi all,
please look into this small piece of code and tell me why my values
weren't stored. Ive searched for hours on an explanation, but found
none.
Ive got an class with (in this example) 2 ints and want to set an read
them
out of another implementation. BUT i always get zeros back.
Ive also tried that with pointer (eg mycur=new curve() but same
result.
Thanks in advance for any reply
Rene
class definition:
class curve
{
public:
curve()
{
}
int ckeytime;
int ckeyspeed;
void setCurvekeyTime (long t)
{
ckeytime=t;
}
void setCurvekeySpeed (long s)
{
ckeyspeed=s;
}
int CurvekeyTime() {
return ckeytime;
}
int CurvekeySpeed() {
return ckeyspeed;
}
};
implementation other class:
public: curve mycur;
one void:
mycur.setCurvekeyTime(11);
mycur.setCurvekeySpeed(12);
other void:
cout << mycur.CurvekeyTime() << endl;
cout << mycur.CurvekeySpeed() << endl;
results in:
0
0
please look into this small piece of code and tell me why my values
weren't stored. Ive searched for hours on an explanation, but found
none.
Ive got an class with (in this example) 2 ints and want to set an read
them
out of another implementation. BUT i always get zeros back.
Ive also tried that with pointer (eg mycur=new curve() but same
result.
Thanks in advance for any reply
Rene
class definition:
class curve
{
public:
curve()
{
}
int ckeytime;
int ckeyspeed;
void setCurvekeyTime (long t)
{
ckeytime=t;
}
void setCurvekeySpeed (long s)
{
ckeyspeed=s;
}
int CurvekeyTime() {
return ckeytime;
}
int CurvekeySpeed() {
return ckeyspeed;
}
};
implementation other class:
public: curve mycur;
one void:
mycur.setCurvekeyTime(11);
mycur.setCurvekeySpeed(12);
other void:
cout << mycur.CurvekeyTime() << endl;
cout << mycur.CurvekeySpeed() << endl;
results in:
0
0