• 2021-04-14
    有如下结构体类型和变量的定义,在C语法中如下赋值错误的是()。
    struct info{
    int no;
    double ave;
    char gender;
    char name[10];
    }stu;
  • stu.name="zhangsan";

    内容

    • 0

      在如下结构体定义中,不正确的是()。 A: struct teacher{ int no; char name[10]; float salary;}; B: struct tea[20]{ int no; char name[10]; float salary;}; C: struct teacher{ int no; char name[10]; float salary; }tea; D: struct{ int no; char name[10]; float salary; }tea;

    • 1

      在如下结构体定义中,不正确的是○。 A: struct student { int no; char name[10]; float score; } B: struct stud[20] { int no; char name[10]; float score; } C: struct student { int no; char name[10]; float score; }stud[20]; D: struct{int no;char name[10];float score;}stud[100];

    • 2

      设有一结构体类型变量定义如下: struct date { int year; int month; int day; }; struct worklist { char name[20]; char sex; struct date birthday; } person; 若对结构体变量person的出生年份进行赋值时,下面正确的赋值语句是

    • 3

      设有一结构体类型变量定义如下,若对结构体变量w1的出生年份year进行赋值,下面正确的赋值语句是( )。 struct date { int year; int month; int day; }; struct worker { char name[20]; char sex; struct date birthday; }w1;

    • 4

      设有一结构体类型变量定义如下: struct date {  int year; int month; int day; }; struct worker {  char name[20]; char sex; struct date birthday; }w1; 若对结构体变量 w1的出生年份进行赋值,下面正确的赋值语句是( )