阿摩線上測驗 登入

申論題資訊

試卷:110年 - 110-2 國立清華大學期末考試題_電機工程學系:計算機程式設計#112945
科目:程式設計
年份:110年
排序:0

題組內容

1. (20%) Answer the following questions briefly.

申論題內容

(a) For a class with a class name as T. What is the name of its destructor function? (5%)

詳解 (共 1 筆)

詳解 提供者:hchungw
In C++, the destructor for a class named T would be named ~T. Destructors are special member functions that are called when an object of that class is destroyed. They serve the purpose of freeing resources, closing files, or releasing memory that the object may have acquired during its lifetime. The syntax for a destructor is similar to that of a constructor, but with a tilde (~) prefixing the class name.