怎么移动?我不清楚,还请大家帮忙!!!!!!!!!!
我定义了个
struct Node{
int num;
struct Node *next;
};
typedef Node *List;
并写了个class
class Gather{
public:
Gather& Insert_elem(int);
............
private: List _front; //使用结构体,定义了2个结点
List _rear;
}
在我写成员函数时,有很多,我只举个例子:
如:
Gather& Gather::Insert_elem(int elem)
{ Node *temp= new Node;
temp = _front; //让临时结点指向头结点
......
//在循环中,我要让临时结点向前不断的加
我的办法是:
temp++;
}
我调试并测试后,发现,temp++;是不对的,不能单纯的用temp++;使temp指向temp的下一个
我只好用: temp = temp->next;
这样虽然解决了向前走的问题,可新的问题又来了!
我有时还需要让temp指向它的前一个,显然temp--肯定不行。
又由于我无法保存temp的前一个,所以不能用临时的变量纪录,再指回去的方法。
我向直接在temp上操作!
那我我该怎么做?????????
struct Node{
int num;
struct Node *next;
};
typedef Node *List;
并写了个class
class Gather{
public:
Gather& Insert_elem(int);
............
private: List _front; //使用结构体,定义了2个结点
List _rear;
}
在我写成员函数时,有很多,我只举个例子:
如:
Gather& Gather::Insert_elem(int elem)
{ Node *temp= new Node;
temp = _front; //让临时结点指向头结点
......
//在循环中,我要让临时结点向前不断的加
我的办法是:
temp++;
}
我调试并测试后,发现,temp++;是不对的,不能单纯的用temp++;使temp指向temp的下一个
我只好用: temp = temp->next;
这样虽然解决了向前走的问题,可新的问题又来了!
我有时还需要让temp指向它的前一个,显然temp--肯定不行。
又由于我无法保存temp的前一个,所以不能用临时的变量纪录,再指回去的方法。
我向直接在temp上操作!
那我我该怎么做?????????
...全文
相关推荐
11.2 (15C107)
iOS 11.2 (15C107) 设备支持文件,用于给不想升级xcode9的童鞋在旧版本的xcode上进行真机调试
真机调试包iOS11.2 (15C107)
真机调试包 ,用于解决Xcode版本过低无法连接高版本手机调试的问题。
xcode iOS 11.2 (15C107)
解压放在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/目录下
11.2 (15C107)11.2.1 (15C153)
Xcode 9.2里copy出来的。 。
deviceSupport_11.2(15C107)
could not find developer disk image Xcode配置包iOS11.2(15C107)


