mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-03 02:24:11 +08:00
21 lines
309 B
C++
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();
|
|
}
|
|
|