CPlusPlusThings/basic_content/static/static_funciton.cpp
Light-City 8edbbbc5a2 update
2019-11-05 16:56:07 +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();
}