ex1.lst

来自「零基础单片机C语言设计全套教程」· LST 代码 · 共 44 行

LST
44
字号
C51 COMPILER V8.08   EX1                                                                   09/04/2008 15:27:06 PAGE 1   


C51 COMPILER V8.08, COMPILATION OF MODULE EX1
OBJECT MODULE PLACED IN ex1.OBJ
COMPILER INVOKED BY: C:\Program Files\keil\C51\BIN\C51.EXE ex1.C BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include <stdio.h>                                              //头文件
   2          
   3          struct lesson                                                   //声明结构lesson
   4          {
   5          float Chinese;                                                  //语文成绩
   6          float English;                                                  //英语成绩
   7          float Math;                                                     //数学成绩
   8          };
   9          
  10          struct student                                                  //声明结构student
  11          {
  12          int     num;                                                            //学号
  13          char name[20];                                                  //姓名
  14          char sex[2];                                                    //性别
  15          int     age;                                                            //年龄
  16          struct lesson result;                                           //各科成绩
  17          };
  18          
  19          void main()                                                     //主函数
  20          {
  21   1      struct student Bob;                                             //声明结构变量
  22   1      Bob.num=210;
  23   1      Bob.name="Bob ";                                                //对每个成员进行赋值
*** ERROR C213 IN LINE 23 OF EX1.C: left side of asn-op not an lvalue
  24   1      Bob.sex="M";
  25   1      Bob.age=22;
  26   1      Bob.result.Chinese=90.5;
  27   1      Bob. result.English=87.5;
  28   1      Bob. result.Math=96.0;
  29   1      printf("%d %s %s %d %f %f %f \n",                       //输出变量的成员值
  30   1      Bob.num, Bob.name, Bob.sex, Bob.age, Bob.result.Chinese, Bob.result.English, Bob.result.Math);
  31   1      }

C51 COMPILATION COMPLETE.  0 WARNING(S),  1 ERROR(S)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?