Hi all,
I am declaring my struct object inside my class private and i am initializing them using constructors but my style checker says that the member function of my struct type are not initialized. Can any one help me in this regards i will be very thankful to you.
Below is my code please suggest some solution to this problem
class Datastructure{
//forward decleration
struct Ship;
public:
//Constructor DS class
Datastructure();
//Destructor DS class
~Datastructure();
private:
struct Ship{
std::string s_class;
std::string name;
unsigned int length;
Ship();
Ship(const std::string& shipClass, const std::string& shipName,
unsigned int len);
};
Ship minShip;
Ship maxShip;
std::vector<Ship> shipVector;
};
#endif
it is giving me the following warnings
CIMP, line 17: Uninitialized member variables in class 'Datastructure'.
FSCH, line 17: No access specifiers at the beginning of class
'Datastructure'.
IVAP, line 62: Field 'minShip' in class 'Datastructure' is not initialized.
IVAP, line 63: Field 'maxShip' in class 'Datastructure' is not initialized.
IVAP, line 64: Field 'shipVector' in class 'Datastructure' is not
initialized.