正在加载图片...
511结构体的引出及使用 3、结构体变量的引用 格式:结构体变量名。成员名 struct student struct student stI i { char name10; strep(stl.name,“Mary”); int age stl age=21; int SI, S2 stl. sI=78 st1.s2=86; 说明: (1)一般情况下都是对结构体变量的成员进行赋值和 输入输出 (2)特殊情况下结构体变量可以进行整体赋值 (3)可以引用结构体变量的地址和其成员的地址5.1.1 结构体的引出及使用 3、结构体变量的引用 格式: 结构体变量名. 成员名 struct student { char name[10] ; int age ; int s1 , s2 ; } ; struct student st1 ; strcpy(st1. name, “Mary” ); st1. age = 21 ; st1. s1 = 78 ; st1. s2 = 86 ; 说明: (1) 一般情况下都是对结构体变量的成员进行赋值和 输入\输出 (2) 特殊情况下结构体变量可以进行整体赋值 (3) 可以引用结构体变量的地址和其成员的地址
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有