16 lines
347 B
C++
16 lines
347 B
C++
#include <iostream>
|
|
#include "test.h"
|
|
|
|
short Test::creation_count = 0;
|
|
Test::Test(int a) {
|
|
this->a = a;
|
|
creation_count++;
|
|
}
|
|
Test::~Test() {
|
|
creation_count--;
|
|
}
|
|
|
|
void Test::print() const {
|
|
std::cout << "The objects value is: " << a << "\n";
|
|
std::cout << "There have been " << creation_count << " objects created" << std::endl;
|
|
} |