Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coding-streams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
coding_tug
coding-streams
Commits
7bc2ff16
Commit
7bc2ff16
authored
4 years ago
by
Karakas, Aleksandar
Browse files
Options
Downloads
Patches
Plain Diff
make destructor of base class virtual
parent
2a3aa83a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
2021-oop1/vo/stream-04-vererbung/2_pets_w_polymorphism/pet.hpp
+2
-2
2 additions, 2 deletions
...oop1/vo/stream-04-vererbung/2_pets_w_polymorphism/pet.hpp
with
2 additions
and
2 deletions
2021-oop1/vo/stream-04-vererbung/2_pets_w_polymorphism/pet.hpp
+
2
−
2
View file @
7bc2ff16
...
@@ -15,7 +15,7 @@ class Pet {
...
@@ -15,7 +15,7 @@ class Pet {
strcpy
(
name_
,
name
);
strcpy
(
name_
,
name
);
}
}
Pet
(
const
Pet
&
other
)
=
delete
;
Pet
(
const
Pet
&
other
)
=
delete
;
~
Pet
()
{
delete
[]
name_
;
}
virtual
~
Pet
()
{
delete
[]
name_
;
}
unsigned
getAge
()
{
return
age_
;
}
unsigned
getAge
()
{
return
age_
;
}
void
setAge
(
unsigned
age
)
{
age_
=
age
;
}
void
setAge
(
unsigned
age
)
{
age_
=
age
;
}
// virtual void drink() = 0; // if we use this line instead of the next, Pet becomes an abstract class.
// virtual void drink() = 0; // if we use this line instead of the next, Pet becomes an abstract class.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment