可怕的C++測驗

剛剛的測驗本來還算容易的,可是卻被我的一個小小錯誤,賠上了我的時間!
本來可以在半個小時之內完成的實驗,我卻花了整整兩個小時.
結果我的錯誤是…
matrix::matrix() //constructor
{
rows=0;
cols=0;
delete[] element; <-三百多行字的程式,就因為這一行而不能compile!
}

氣死我了.
害得我一直問自己:「我真的那麼差嗎?」
還好我趕在最後一分鐘完成這個程式,並且找出這只小蟲蟲!
呵呵.


5 Comments

  • rushie26

    4 9 月, 2004

    woah.. matrix functions siah.. keke! but delete[]element? how come consructor func need to delete ah?

    • Kongnir

      4 9 月, 2004

      At first i thought i need to initiate the element, so i “make sure” the element is “empty”. But I think i geh zhua liao, actually no need one. Moreover, there is no “new” in the first place, so system won’t allow “delete” at the beginner of the program. My mistake, haha.

      • rushie26

        4 9 月, 2004

        hehe… the data struct practical tests r always very nerve wrecking lor.. the time i did the test until sweat ah..hehe! but good tat u managed to find the mistake and corrected it b4 the end of the test. hehe..

  • froidhiver

    4 9 月, 2004

    dun understand.. keke..

  • neuron80

    5 9 月, 2004

    Don know wad talkin everyone…. LOL.. 😛

Comments are closed.