Home > Back-end >  Trouble bosses look at the c language to be the problem
Trouble bosses look at the c language to be the problem

Time:10-13

# include
Int main ()
{
Struct student
{
Int num.
char name[20];
Float score;

} student1 student2;
Scanf_s (" % d % s % f ", & amp; Student1 num, student1. Name, & amp; Student1. Score); (a hot iron)
return 0;
}
Book so Tan Haoqiang Tan Haoqiang book is not very good but we are using this book trouble bosses give guidance, by the way of learning c language better book thank you.

CodePudding user response:

Change the scanf_s to the scanf,
Scanf_s, unlike the scanf parameters, specific can Google baidu oneself view two functions,
In addition, the best struct student structure definition at the top of the main method (this has nothing to do with the problem, of course),

CodePudding user response:

 scanf_s (" % d % s % f ", & amp; Student1 num, student1. Name, 20, & amp; Student1. Score); 


For your reference ~

The length of the need to specify the name,
  • Related