首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

c++找错!解决办法

2012-05-01 
c++找错!!~~C/C++ codetemplate typename Tvoid insertValue(nodeT *front,nodeT *target,int n){if

c++找错!!~~

C/C++ code
template <typename T>void insertValue(node<T> *front,node<T> *target,int n){    if(n=0) { target->next=front;first=target;}    for(int i=1;i<n;i++){        front=front->next;    }    target->next=front->next;    front->next=target;}


[解决办法]
你里面的first哪里来的,没声明吧
[解决办法]
if(n=0) { target->next=front;first=target;}

加上return:
if(n=0) { target->next=front;first=target;return;}

热点排行