Is this C or C++? You're using malloc and structs, which implies C-style programming, but you have a constructor, implying it's actually C++.
If C++, why not do something like this:
class Wheel
{
public:
Wheel()
{
//Do the thing that you only want to do once here.
}
}
Or this:
class Wheel
{
public:
Wheel()
{
//Do the thing that you only want to do once here.
}
void Spin()
{
if(!hasAlreadyBeenSpun)
this->doThatThingYouOnlyDoOnce();
}
private:
bool hasAlreadyBeenSpun = false;
void doThatThingYouOnlyDoOnce()
{
//Your code goes here.
}
}
The first option is much better though, because if a function says "Spin()", I expect the function to do what it says. Coding is hard enough without function names lying to you.
Maybe you want the constructor to spin, and you actually want a function called "GetResultOfSpin()"?