C++ Online Compiler & Playground
HTML/CSS/JavaScript
HTML
CSS
Javascript
C++
C
PHP
Java
Python
Swift
C#
Ruby
Node.JS
Kotlin
jQuery
Go
R
TypeScript
Start C++ Course
Register
static member function
0
Author: Disha Dey
Dark
Public
Save
CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include
<
iostream
>
using
namespace
std
;
class
A
{
static
int
count
;
public
:
static
void
data
(
int
a
)
{
count
=
a
;
}
};
void
show
()
{
A::data
(
20
);
A a
;
a
.
show
();
getch
();
}
Enter to Rename, Shift+Enter to Preview
OUTPUT