C++ examples for Class:Class Creation
Defining a Class with a Member Function
#include <iostream> class MyClass {/*from w w w .ja v a 2s .c o m*/ public: void displayMessage() { std::cout << "Welcome to the Grade Book!" << std::endl; } }; int main(int argc, const char *argv[]) { MyClass myMyClass; // create a MyClass object named myMyClass myMyClass.displayMessage(); return 0; }