1
0
LearningCPP/main.cpp

43 lines
606 B
C++
Raw Normal View History

2022-08-12 14:59:08 +01:00
#include <iostream>
2022-08-26 13:58:55 +01:00
#include <random>
#include <chrono>
2022-08-13 00:34:25 +01:00
2022-11-25 12:24:19 +00:00
class A {
public:
A() {
std::cout << "Class A Created\n";
}
2022-11-25 12:24:19 +00:00
~A() {
std::cout << "Class A Destroyed\n";
}
2022-11-25 12:24:19 +00:00
};
2022-11-25 12:24:19 +00:00
class B {
public:
B() {
std::cout << "Class B Created\n";
2022-08-26 11:55:54 +01:00
}
2022-11-25 12:24:19 +00:00
~B() {
std::cout << "Class B Destroyed\n";
}
};
2022-11-25 12:24:19 +00:00
class C : public A {
B b{};
public:
C() {
std::cout << "Class C Created\n";
}
~C() {
std::cout << "Class C Destroyed\n";
}
2022-11-25 12:24:19 +00:00
};
int main()
{
A v{};
B w{};
C x{};
return 0;
}