Freemason Hirams Travels Masonic Forums  

Go Back   Freemason Hirams Travels Masonic Forums > Education & Reference > Teaching

Teaching Teaching

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-26-2008, 03:35 PM
Member
 
Join Date: Feb 2008
Posts: 1
Rep Power: 0
yichi has a spectacular aura about
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>:Head" to access to pHead.

//*************************//
//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 Listublic ablist <type>{
public:
List(){
pHead = new ListNode <type>; //ERROR occured here

//If I didn't use "ablist <type>:Head" , this piece of code won't compile correctly

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
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


All times are GMT -5. The time now is 03:51 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154