File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -285,14 +285,15 @@ public:
285
285
};
286
286
287
287
int main() {
288
- Dictionary<char * , char * > * dict = new Dictionary<char* , char* >(10);
288
+ auto dict = new Dictionary<char* , char* >(10);
289
289
dict->print();
290
290
dict->add("apple", "fruit");
291
291
dict->add("banana", "fruit");
292
292
dict->add("dog", "animal");
293
293
dict->print();
294
-
295
- Dictionary<int, char* >* dict_specialized = new Dictionary<int, char* >(10);
294
+ delete dict;
295
+
296
+ auto dict_specialized = new Dictionary<int, char* >(10);
296
297
dict_specialized->print();
297
298
dict_specialized->add(100, "apple");
298
299
dict_specialized->add(101, "banana");
@@ -302,6 +303,7 @@ int main() {
302
303
dict_specialized->sort();
303
304
cout << endl << "Sorted list:" << endl;
304
305
dict_specialized->print();
306
+ delete dict_specialized;
305
307
}
306
308
```
307
309
You can’t perform that action at this time.
0 commit comments