Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Base {
- private:
- int *a;
- // int b = 4;
- public:
- Base() {
- //try {
- a = new int[100]; // Выделение места в динамической памяти, память не высвобождается с помощью delete[]
- //}
- //catch
- throw runtime_error("err");
- }
- ~Base() {
- // delete[] a;
- }
- };
- int main() {
- Base base;
- return 0;
- }
Add Comment
Please, Sign In to add comment