Making an entire class private
hi,
I am currently in the process of coding a function that uses a class.Let me explain in detail...
Code:
CalculateValue int ();
This function uses a class that I coded, therefore it instantiate class, method that are used etc.. But now I want my function "CalculateValue' can not be access by variable from outsite of class.
Is this possible?
Re: Making an entire class private
Much better: if you implement your function in a cpp file and you can implements the class in that file (no header or anything else for this class :
Code:
private class
(
public:
private int ()
(
Return 42;
)
/ / Etc ...
);
Like that, your function can be accessible in this class only and it will not possible for anything else to have the class definition.
This is called an implementation.
Re: Making an entire class private
1. -Create a new application in C++
2. -Add the following code about
your class:
Code:
class addressC {
//
private:
//
string abs;
string SSS;
string fff;
//
public:
addressC( string absS, string SSSS, string fffS); // constructor
~addressC(); // destructor
void PROCView();
};
3. -Then give the code for the procedures or functions used in that
class.