Home > Back-end >  [new turn] why did the C pointer address remains the same in the list
[new turn] why did the C pointer address remains the same in the list

Time:09-29

[code=c + +]
#include
#include
Struct list {
int a;
The list * next;
};
Int main ()
{
using namespace std;
The list * h;//head
The list * e;//end
The list * t;//temp
int temp;
Int o;

T=new list ();
H=new list ();
E=h;
E - & gt; Next=NULL;
Cout & lt; <"How many do you want to create?" Cin & gt;> o;
Cout & lt; <"Both Please enter the number:";
Cin & gt;> Temp.
H - & gt; A=temp.
H - & gt; Next=e;
For (int j=0; J & lt; O - 1; J++)
{
T=new list ();
Cout & lt; <"Both Please enter the number:";
Cin & gt;> Temp.
E - & gt; Next=t;
E=t;
}
T=h;
For (int I=0; i {

Cout & lt; <"No." & lt; Cout & lt; <& T & lt; <"" & lt; }
system("pause");
return 0;
}
[/code]

CodePudding user response:

 
For (int I=0; i {

Cout & lt; <"No." & lt; Cout & lt; <& T & lt; <"" & lt; }

CodePudding user response:

reference 1st floor GKatHere response:
 
For (int I=0; i {

Cout & lt; <"No." & lt; Cout & lt; <& T & lt; <"" & lt; }


Oh, well... Got it! Thank you very much!
  • Related