码迷,mamicode.com
首页 > 其他好文 > 详细

Writing Portable Programs

时间:2014-07-16 15:51:58      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:http   os   for   io   re   c   

  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   os   for   io   re   c   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!