CPlusPlusThings/english/basic_content/static/static_funciton.cpp
2020-07-19 10:38:38 +08:00

21 lines
309 B
C++

#include<iostream>
using namespace std;
class Apple
{
public:
// static member function
static void printMsg()
{
cout<<"Welcome to Apple!";
}
};
// main function
int main()
{
// invoking a static member function
Apple::printMsg();
}