Home > Back-end >  Sort VS2019 structure errors
Sort VS2019 structure errors

Time:10-07

Why VS209 structure sorting error?
Images to the data of Power calculation value, namely Actual_Signal [] Power,
Ch were exchanged defined structure,


Void Power_sorting ()
{
Int I, j, k;
For (I=0; I & lt; Actual - 1; I++)
K=I;
{
For (j=1 + I; J{
If (Actual_Signal [j]. Power & gt; Actual_Signal [k]. Power)//press from big to small order
{
k=j;//record maximum power position subscript
}
If (k!=I)//if not subscript subscript shop location I
{
Ch=Actual_Signal [k].
Actual_Signal [k]=Actual_Signal [I];
Actual_Signal [I]=ch;
}
}
}//selection method
}

Thank you

CodePudding user response:

Structure is a global variable
  • Related