C++3 对象与类 例子.pptVIP

  • 7
  • 0
  • 约1.11万字
  • 约 32页
  • 2018-11-02 发布于福建
  • 举报
C3对象与类例子

巩固练习: 看懂讲义指定的所有例题 课后作业【3.3】【3.6】上机实践,自定义main函数测试结果 * #include iostream.h struct MESSAGE{ char flag; //消息类别标志 int size; //消息长度 char buff[255]; //消息缓冲区 long sum; //消息累加和 }; void main (void) { coutSize of single word is sizeof (int) ; //假定sizeof (int)=2 coutSize of double word is sizeof (long) ; //假定sizeof (long)=4 cout\nSize of Message is:sizeof (Message) ; } * 紧凑方式:一个成员紧接着前一个成员存放,则: sizeof (MESSAGE) =1+2+

文档评论(0)

1亿VIP精品文档

相关文档