Definition file and class test
This commit is contained in:
15
test.cpp
Normal file
15
test.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <iostream>
|
||||
#include "test.h"
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user