第04章字符串元胞构架体(03).pptVIP

  • 5
  • 0
  • 约1.48万字
  • 约 67页
  • 2020-04-11 发布于福建
  • 举报
* * * * Prof. cao congyong- Lecture Notes * 5.获取构架数组中的域值 可直接引用或利用函数getfield来获得构架数组中的域值。格式为: (1) struct_name(i,j).field_name(m,n) (2) getfield(struct_name,{i,j},’field_name’,{m,n}) student(1).number getfield(student,{1},’number’) 多构架数组域的获取比较复杂,有时需要通过循环程序来实现. 4.3.4 结构数组的操作 4.3 结构数组 Prof. cao congyong- Lecture Notes * 6.设置构架数组中的域值 可直接赋值或利用函数setfield。格式为: (1) struct_name(i,j).field_name(m,n)=field_value (2) struct_name=setfield(struct_name,{i,j},’field_name’,{m,n},field_value) 4.3.4 结构数组的操作 4.3 结构数组 Prof. cao congyong- Lecture Notes * 例1:构架数组student有name和age两个属性。两

文档评论(0)

1亿VIP精品文档

相关文档