Friday, 3 October 2014

Example of static member function (OOP)

 # include <iostream>
 using namespace std;

////////  Example of static member function  /////////

class StaticFunction
{
      
      public:
            
             static void show()    // static member function
             {
                  cout<<"Welcome to static member function"<<endl;
             }         
};
int main()
{
    StaticFunction::show();      // call a static member function
    system("pause");
}

No comments:

Post a Comment