Files
GitTutorial/test.cpp
2023-07-27 12:20:25 -07:00

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;
}