AJAX,你说的那个函数指针不会用
<P>类里的声明<BR>bool (*p[])(); <BR><BR> 我在这里初始化<BR>template <class T><BR>List<T>::List()<BR>{<BR> curr_len=0;<BR> Pdata=NULL;<BR> bool (*p[])() ={List<T>::FuctionTextForListCreat,List<T>::FuctionTextForFindListNode,<BR> List<T>::FuctionTextForDelete,List<T>::FuctionTextForInsert,List<T>::FuctionTextForModify,<BR> List<T>::ClearList};<BR>}<BR><BR><BR>使用<BR>List<int> tmp;<BR>tmp.p[0]();<BR><BR> 错误<BR> warning C4200: nonstandard extension used : zero-sized array in struct/union<BR>error C2248: 'p' : cannot access private member declared in class 'List<int>'<BR><BR>程序打不开了,你先看这个吧,看不出来我哪天再发上来[em04]<BR>大概意思好象是P没空间.那NEW什么呢,void []????????</P><P>template<class T><br>List<T>::List()<br>{<br> bool (List<T>::*p[])(void) = {List<T>::FuctionTextForListCreat, List<T>::FuctionTextForFindListNode};<br>}<br></P>
[align=right][color=#000066][此贴子已经被作者于2006-10-5 7:59:01编辑过][/color][/align]
<P>[em15]</P>
[align=right][color=#000066][此贴子已经被作者于2006-11-30 12:48:59编辑过][/color][/align]
页:
[1]
