If the code
In order to facilitate debugging, I first define a setfirst function information input in advance a few students in the main function, convenient debugging sort function
Then in this sort output function (outputinfo), originally wanted to use bubble sort method and the output, but always run out
Trouble, have a look at why such mistakes how to change information to ascending output with overall grades students!!!!!! Is a matter of class set!!!!! Very urgent!!!!! Trouble you more correct!!!!! Thank you humble small white online
Outinfo function code
Void outputinfo ()
{
Node * p;
Node * q;
The Node temp.//intermediate variable
For (p=head - & gt; next; P - & gt; Next!=NULL; P=p - & gt; Next)
{
For (q=p - & gt; next; Q!=NULL; Q=q - & gt; Next)
{
If (p - & gt; The info - & gt; The summary & lt; Q - & gt; The info - & gt; The summary)
{
Temp. Info=p - & gt; The info.
P - & gt; Info=q - & gt; The info.
Q - & gt; Info=temp. The info;
}
}
}
Node * s=head;
for (int i=0; i
S=s - & gt; next;
Cout & lt; <"Name:" & lt;
}
};
Thank you again for a minute!!!!!!
CodePudding user response:
0 XCDCDCD said there was no initialization, i.e., the memory is not assigned spaceCodePudding user response: