mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-03 18:43:52 +08:00
update
This commit is contained in:
20
basic_content/static/static_funciton.cpp
Normal file
20
basic_content/static/static_funciton.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user