Then I write code is:
#include
Struct studentinfo
{
Int score;
Struct studentinfo * next;
} st1 st2, st3;
Void Print_Score (struct student * st1)
{
Printf (" st1. \ n score=% d ", st1 - & gt; Score);
Printf (" st2. \ n score=% d ", st1 - & gt; Next - & gt; Score);
Printf (" st3. \ n score=% d ", st1 - & gt; Next - & gt; Score);
}
Int main ()
{
St1. Score=100;
St2. Score=98;
St3. Score=96;
St1. Next=& amp; St2.
St2. Next=& amp; St3;
St3. Next=NULL;
Print_Score (& amp; St1);
return 0;
}
Then the DVC compiler error above, change for a long time did not come out, for bosses to solve!!!!!!!!!!!
CodePudding user response:
Student should be studentinfoCodePudding user response:
Is a linked list,Printf (" st3. \ n score=% d ", st1 - & gt; Next - & gt; Score);=="" printf (" st3. Score=% d \ n", st2 - & gt; Next - & gt; Score);
CodePudding user response:
# include & lt; stdio.h>
Struct studentinfo
{
Int score;
Struct studentinfo * next;
} st1 st2, st3;
Void Print_Score (struct studentinfo * st1)
{
Printf (" st1. \ n score=% d ", st1 - & gt; Score);
Printf (" st2. \ n score=% d ", st1 - & gt; Next - & gt; Score);
Printf (" st3. \ n score=% d ", st1 - & gt; Next - & gt; Next - & gt; Score);
}
Int main ()
{
St1. Score=100;
St2. Score=98;
St3. Score=96;
St1. Next=& amp; St2.
St2. Next=& amp; St3;
St3. Next=NULL;
Print_Score (& amp; St1);
return 0;
}
For your reference ~
Where Print_Score function parameter type declaration?