Call a constructor after created a copy of the Class
Hi
I am a newbie, so I am trying to do something like
MyDigi Digitizer;MyDigi.Reset();
The Reset() class actually sets some default values.
Now, I want to use the the MyDigi to call another Class, ie like
MyDigi.Digitizer(float float).
The Digitizer is actually a constructor ie
|
Digitizer::Digitizer(float var1_, float var2_);
|
However this fails with
error: invalid use of 'class Digitizer' |
any help appreciated.
thanks
Alex
Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
struct Digitiser
{
Digitiser( float var1_, float var2_ ) { /* ... */ }
// ...
};
struct MyDigi
{
void reset() { my_digitiser = Digitiser( 0.0f, 0.0f ) ; /* .. */ }
// ...
private: Digitiser my_digitiser{ 0.0, 0.0f } ;
// ...
};
|
Topic archived. No new replies allowed.