![]() |
| | |||||||
| Teaching Teaching |
| | LinkBack | Thread Tools | Display Modes |
| |||
| ERROR,C++,data structures,teaching myself,setback? I am teaching myself C++ & data structures these days, and now I encountered a UNBELIEVABLE setback! I have been busy solving it right now and I feel exhausted. Please take your time and check my code, it's an unbelieve error. "class List" is inherited from base class "ablist". I wondered why accessing "pHead""length" etc; is forbidden in class list, even they are inherited from "ablist"? I hve to use "ablist <type>: //*************************// //ListNode //*************************// template <class type> class ListNode { public: ListNode(); type data; ListNode <type>* pNext; }; //Fuction(){codes..}.. //*************************// //ablist //*************************// template <class type> class ablist { public: ListNode <type> *pHead; ListNode <type> *pCurrent; ListNode <type> *pTail; int length; //Fuction(){codes..}.. }; //Fuction(){codes..}.. //*********** template <class type> class List public: List(){ pHead = new ListNode <type>; //ERROR occured here //If I didn't use "ablist <type>: ablist <type>::length=0; //it works } ~List(){ ablist <type>::MakeEmpty(); //OK delete pHead; //forbidden } }; //Fuction(){codes..}.. //end What can I say to express my feelings towards your help? //I come from China, please feel free to contact me and correct my mistake if you find anything wrong/not idiomatic in my English usage. |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hardware Error - Memory Parity Error. What is this? | scenesterxkid | Hardware | 0 | 04-09-2008 12:42 AM |
| "There was a problem retieving weather data." error? | xrCISE | Weather | 0 | 03-06-2008 03:35 PM |
| yahoomail error: there was a problem retrieving weather data.please try again later? | ratnakar r | Weather | 0 | 03-06-2008 12:46 PM |
| what is the beast book for data structures in JAVA?? | dihsh | Books & Authors | 0 | 03-01-2008 11:02 PM |
| Has anyone figured out a way to get rid of the weather data popup error message? | oakleydee | Weather | 0 | 02-29-2008 03:14 PM |