Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*An easy explained view of Encapsulation in C++.*/
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- class Random_Class
- {
- public:
- void publicFunction()
- {
- privateFunction();
- }
- private:
- void privateFunction()
- {
- cout << "Random text!!!" << endl;
- }
- };
- int main()
- {
- Random_Class object1;
- object1.publicFunction();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement