lundi 30 mars 2015

Declaring An Instance Of A Class With Member Initializers In Another Class

So I have a class whose contructor contains member initializers like so:



class aClass
{

public:

//Functions
aClass(int sVal1, float sVal2, float sVal3,float sVal4); //Constructor
~aClass(); //Destructor
};


The constructor looking like this in the .cpp file of the class:



NPC::NPC(int sVal1, float sVal2, float sVal3, float sVal4)
:someValue(sVal1), sSomeValue(sVal2), tSomeValue(sVal3), fSomeVlaue(sVal4)
{

}


My question is: if I were to declare an instance of this class in another class header file as a private variable, what would the syntax of declaration be?


Aucun commentaire:

Enregistrer un commentaire