1 00:00:00,770 --> 00:00:08,000 Distractors in C++, so an object's destructor is its clean up function. 2 00:00:08,000 --> 00:00:13,010 So this destructor is invoked before an object is destroyed. 3 00:00:13,010 --> 00:00:19,940 So distractors are almost never called explicitly, So the compiler will ensure that the each object's 4 00:00:19,940 --> 00:00:22,910 detractor is called as appropriate. 5 00:00:22,910 --> 00:00:27,380 So you declare a class destructor with the child here. 6 00:00:28,130 --> 00:00:33,080 Child followed by the name of the class here. 7 00:00:33,200 --> 00:00:34,220 Child here. 8 00:00:35,460 --> 00:00:37,290 My date and time. 9 00:00:37,650 --> 00:00:39,930 This way you can sit a distractor here. 10 00:00:41,110 --> 00:00:41,740 So. 11 00:00:43,380 --> 00:00:47,070 Here we declare that my date and time destructor. 12 00:00:47,130 --> 00:00:53,850 So here, let's let's write a sound called here that will. 13 00:00:54,890 --> 00:00:57,710 Tell us when the object will. 14 00:00:57,710 --> 00:01:05,360 We will print some we will print something on the console screen when our object is distracted here. 15 00:01:05,930 --> 00:01:11,630 Object this destructor here. 16 00:01:11,960 --> 00:01:15,320 So defining this destructor is optional. 17 00:01:15,320 --> 00:01:20,900 So if you decide to implement a destructor, it must not take any arguments. 18 00:01:21,110 --> 00:01:28,130 Examples of actions you might want to take in a destructor include releasing file handler handlers, 19 00:01:28,130 --> 00:01:31,850 flushing network circuits, and freeing dynamic objects. 20 00:01:31,850 --> 00:01:37,490 So if you don't define a destructor, a default destructor is automatically generated. 21 00:01:37,490 --> 00:01:42,290 So the default destructor behavior is to perform no action. 22 00:01:42,290 --> 00:01:48,650 So you you will learn a whole lot more about distractors in the next lectures.