Home > Back-end >  Can't read, please bosses analyse
Can't read, please bosses analyse

Time:11-07

#include
#include

Struct node
{
Int a;
Struct node * next;
};
Int main ()
{
Head, struct node * * p * q * t;
The head=NULL;
Q=NULL;
//p=NULL;

Int n, b;
Printf (" please enter n number ");
Scanf_s (" % d ", & amp; N);
for (int i=1; I & lt;=n; I++)
{
Scanf_s (" % d ", & amp; b);
P=(struct node *) malloc (sizeof (struct node));

P - & gt; a=b;
P - & gt; Next=NULL;
If (head==NULL)
{
The head=p;
}
The else
{
Q - & gt; Next=p;
}
Q=p;

}


Printf (" please enter a number to insert ");
Scanf_s (" % d ", & amp; b);
T=head;
While (t!=NULL)
{
If (t - & gt; Next==NULL | | t - & gt; Next - & gt; a> B)
{
P=(struct node *) (sizeof (struct node));

P - & gt; a=b; //here why can't read the
P - & gt; Next=t - & gt; next;
T - & gt; Next=p;
break;

}
T=t - & gt; next;

}
T=head;
While (t!=NULL)
{
Printf (" % d ", t - & gt; A);
T=t - & gt; next;
}

system("pause");




return 0;
}

CodePudding user response:

 
If (t - & gt; Next==NULL | | t - & gt; Next - & gt; a> B)
{
//p=(struct node *) (sizeof (struct node));
P=(struct node *) malloc (sizeof (struct node));

P - & gt; a=b;//here is what can't read the
P - & gt; Next=t - & gt; next;
T - & gt; Next=p;
break;

}

CodePudding user response:

 p=(struct node *) (sizeof (struct node)); 

P - & gt; a=b;//here is what can't read


What is this grammar?
The malloc is

CodePudding user response:

Dizzy, malloc didn't play up, didn't you see what problem
  • Related