CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by Eikos
#include <iostream>
#include <vector>
using namespace std;
class A
{
public:
static int new_count;
static int cp_count;
static int conv_count;
static int del_count;
A(){new_count++;}
A(const A &a){cp_count++;}
A(int i){conv_count++;}
~A(){del_count++;}
};
int A::new_count = 0;
int A::conv_count = 0;
int A::del_count = 0;
int A::cp_count = 0;
int main() {
cout << "# of created 'A' objects: " << A::new_count << endl;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run