首页 > 其他 > 详细

Writing Portable Programs

时间:2014-07-16 15:52:06      阅读:351      评论:0      收藏:0      [点我收藏+]
  1. Size of Data Types
    1. Always use sizeof() to get the size of types(sizeof(char), sizeof(short), sizeof(int)...)
  2. Do not depend on the order of evaluation in an expression
  3. Char type may be singed or unsigned. Better to use an integer to store the output of getchar().
  4. Use standard Libraries
  5. Write platform-specific code is possible.

Reference from http://www.cs.princeton.edu/courses/archive/spring06/cos217/lectures/24portable.pdf

Writing Portable Programs,布布扣,bubuko.com

Writing Portable Programs

原文:http://www.cnblogs.com/sparkles/p/3848481.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!