Still new to C++ and I'm trying to understand accessing private data, using constructors. How would I display the values of the data members of myClass? Any help would be great. Thanks
class NumberClass
{
public:
void func(); // assigns numeric constants to nNum and fNum
void print() const; //displays the values of nNum and fNum
NumberClass();
NumberClass(int, float);
private:
int nNum;
float fNum;
};
int main()
{
NumberClass myClass;
//display values here
return 0;
}