Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// More Tutorials at BrandonHok.com
- #include <iostream>
- using namespace std;
- class kfcStore
- {
- public:
- void makeFoodFunction()
- // Do you see the void here? This is a data type. You may google for more information.
- // The datatype before a function's name is called a return type
- {
- //what does the function do? [code here]
- cout << "hamburgers";
- cin.get();
- }
- }; // end of class
- // How do we call a function from a class?
- // We have to first create the object and order it to do something
- int main()
- {
- kfcStore objectPopcorn;
- objectPopcorn.makeFoodFunction();
- // What did you think happened here?
- // The class kfcStore made the object 'objectPopcorn'
- // Then we told 'objectPopcorn' to call the 'makeFoodFunction' from its class
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement