Advertisement
Felanpro

Classes (Introduction)

Nov 21st, 2015
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. /*Introduction to classes!*/
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. class FelixClass
  6. {
  7.       public: //This means that anything you put after this you're able to put outside the class!  Other word: "Acces specifier"
  8.      
  9.       void simpleFunction()
  10.       {
  11.            cout << "Random text :)" << endl;
  12.        }
  13.      
  14.       };
  15.  
  16. int main()
  17. {
  18.     FelixClass felixObject;       //Object is basically the key to acces and run stuff from classes!
  19.     felixObject.simpleFunction();
  20.     system("pause");
  21.    
  22.     return 0;
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement