Home > Back-end >  Excuse me, why do you write the struct and this several array?
Excuse me, why do you write the struct and this several array?

Time:06-06

# include
Struct student
{
Char name [21].
Int score;
};
Int main ()
{
Struct student a [100], t;
Int I, j, n.
The scanf (" % d ", & amp; N);
For (I=1; i <=n; I++)

The scanf (" % s % d ", a [I]. Name, & amp; A [I] score);

For (I=1; i <=n - 1; I++)
{
For (j=1; J & lt;=n - (I); J++)
{
If (a [j] score & lt; A [j + 1] score)
{
T=a, [j].
A [j]=a, a + 1 bonus to [j].
A [m + 1]=t;
}
}
}
For (I=1; i <=n; I++)
{
Printf (" % s \ n ", a [I] name);
getchar(); getchar();
}
return 0;
}

CodePudding user response:

C struct cannot direct assignment

CodePudding user response:

reference 1st floor SuperDay response:
C struct cannot direct assignment

CodePudding user response:

refer to the second floor lin5161678 response:
Quote: refer to 1st floor SuperDay response:

C struct cannot direct assignment
can

Would you please tell me why, char name [21]
Int score
Both inside the first array, the second is not, but behind all into array??

CodePudding user response:

reference qq_45815575 reply: 3/f
Quote: refer to the second floor lin5161678 response:
Quote: refer to 1st floor SuperDay response:

C struct cannot direct assignment
can

Would you please tell me why, char name [21]
Int score
Both inside the first array, the second is not, but behind all into array??
people speaking?

CodePudding user response:

reference 4 floor lin5161678 response:
Quote: reference qq_45815575 reply: 3/f

Quote: refer to the second floor lin5161678 response:
Quote: refer to 1st floor SuperDay response:

C struct cannot direct assignment
can

Would you please tell me why, char name [21]
Int score
Both inside the first array, the second is not, but behind all into array??
people speaking?

Is structure to the statement, I am a little don't understand, why didn't a [] a []

CodePudding user response:

reference 4 floor lin5161678 response:
Quote: reference qq_45815575 reply: 3/f

Quote: refer to the second floor lin5161678 response:
Quote: refer to 1st floor SuperDay response:

C struct cannot direct assignment
can

Would you please tell me why, char name [21]
Int score
Both inside the first array, the second is not, but behind all into array??
people speaking?

Is the structure to the statement, I'm a little look not to understand, why didn't a [] a [],

CodePudding user response:

reference 4 floor lin5161678 response:
Quote: reference qq_45815575 reply: 3/f

Quote: refer to the second floor lin5161678 response:
Quote: refer to 1st floor SuperDay response:

C struct cannot direct assignment
can

Would you please tell me why, char name [21]
Int score
Both inside the first array, the second is not, but behind all into array??
people speaking?

Is the structure to the statement, I'm a little look not to understand, why didn't a [] a [],

CodePudding user response:

Don't [] is not an array

CodePudding user response:

refer to the eighth floor liups response:
not [] array

, & amp; A [I] score); This is not an array?

CodePudding user response:

refer to the eighth floor liups response:
not [] array

, & amp; A [I] score); This is not an array?

CodePudding user response:

references 9 f qq_45815575 response:
Quote: refer to the eighth floor liups response:
don't [] is not an array

, & amp; A [I] score); This is not an array?
a is an array of what's wrong with it?

CodePudding user response:

struct student a [100]

CodePudding user response:

references to the tenth floor qq_45815575 response:
Quote: refer to the eighth floor liups response:
not [] array

, & amp; A [I] score); This is not an array?

According to your question, a is an array, t not!

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related