delete-operator

    0熱度

    3回答

    class finder { public: finder(); ~finder(); } int _tmain(int argc, _TCHAR* argv[]) { finder* pfind = new finder(L"test"); finder find(L"test2"); system("PAUSE");

    1熱度

    4回答

    我面臨的一個新問題,一些與內存分配和泄漏這裏是我的錯誤日誌: Dr. Memory version 1.4.6 build 2 built on Mar 7 2012 10:14:04 Application cmdline: ""D:\c++\Begin\Lab3-5_OOP\Debug\Lab3-5_OOP.exe"" Recorded 62 suppression(s) from def

    1熱度

    1回答

    我不斷收到錯誤在VS 2100「CRT檢測到的應用程序寫入到內存堆緩衝區開始之前」 誰能幫助?我的int main一直在底部。當delete []命令在操作者運行發生錯誤=函數 #include "intset.h" const int MAXINITIALSIZE = 5; int IntSet::numOfArray = 0; IntSet::IntSet(int a, int b,

    2熱度

    2回答

    有人可以告訴我什麼是for循環?當我運行它時,它會中斷。我試圖調試,看看有什麼是錯的,我注意到,在for循環,它只是停止: #define MAX_POPULATION 64 float **tr_pop;//Tournament candidates float **matingPool;//Mating pool tr_pop=new float *[m]; matingPool=ne

    7熱度

    2回答

    假設我有一個帶有兩個指針的結構,每個指針指向一個實現了析構函數的對象。此外,假設頭指向Listnode結構旁邊一個非NULL值*學生和*: struct Listnode { Student *student; Listnode *next; }; Listnode *head = new Listnode; 如果我使用delete保留字的Listnode指針「頭」將

    1熱度

    2回答

    我想做一個支持Unicode的C++ hello世界,但我有點卡住了。 我做了一個指向TCHAR的指針[我認爲它是一個char數組],並且在使用它之後,我試圖刪除它。它崩潰說Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)。 檢查interwebs,有人說這是因爲使用了錯誤的刪除。我嘗試了兩次刪除,但它仍然提供相同的消息。 我錯過了一些明顯的東西

    0熱度

    4回答

    我有以下的源代碼時,另一個堆對象被刪除堆對象: void Processmethod() { QDialog *ProcessMessage = new QDialog; Ui::DialogProcessMessage *Dialog = new Ui::DialogProcessMessage(); Dialog->setupUi(ProcessMess

    1熱度

    3回答

    我有下面的類存儲日期對和價格: #include <vector> #include <utility> #include "boost/date_time/gregorian/gregorian.hpp" using std::vector; using std::pair; using boost::gregorian::date; class A { private:

    1熱度

    6回答

    這裏釋放內存的正確方法是什麼? 指針數組包含重複項! class HashTable { Bucket<E>** index = new Bucket<E>*[indexSize]; ... } ~ExtHash() { for (size_t i = 0; i < indexSize; ++i) delete index[i]; de

    7熱度

    3回答

    我需要一個C++複習。爲什麼這會產生內存異常? pear = new char[1024]; pear = "happy go lucky"; delete [] pear; // exception