From 66a5cdf79a8324019d9d34055ad212ad52504e3c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 10 May 2024 11:33:35 +0300 Subject: [w11] Fixes for destructors --- week11/Exercise02/Employee.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'week11/Exercise02') diff --git a/week11/Exercise02/Employee.h b/week11/Exercise02/Employee.h index 7be3574..086f65d 100644 --- a/week11/Exercise02/Employee.h +++ b/week11/Exercise02/Employee.h @@ -7,4 +7,9 @@ protected: char name[512]; char position[128]; char department[64]; + +public: + // Може да имаме полиморфизъм, затова се нуждаем от виртуален деструктор + // В бъдеще ще използваме = default вместо {} + virtual ~Employee() {}; }; -- cgit v1.2.3