{
The node * p=head - & gt; Next, * q;
Int k=0;
If (i<1)
Cout<& lt;" There is no the first "& lt; & lt; i<& lt;" A location "& lt; & lt; Endl;
The else
{
While (p!=NULL& & K{
Node * q=p - & gt; Next; -- -- -- -- -- - in the process of debugging the wrong places, but don't know how to change, the book's code is such, but in here is alright, C - free5.0
P=q;
K++;
}
If (p=NULL)
Cout<& lt;" Beyond the list can be inserted into the largest position!" & lt; & lt; Endl;
The else
{
Node * q=new node;
Q - & gt; data=https://bbs.csdn.net/topics/x;
Q - & gt; Next=p - & gt; Next;
P - & gt; Next=q;
}
}
}
CodePudding user response:
The third line node * p=head - & gt; Next, * q;Node * q=p - & gt; Next; -- -- -- -- -- - the wrong place in the process of debugging,
Defines the two * q, will this reason?
CodePudding user response:
After I remove the q or not,