1.
if ((n > 32,767) or (n < -32,767)) { n.selectUseType =
long; }
2.
if (there are large arrays or many structures) { n.selectUseType =
short; }
3.
if ((well-defined overflow characteristics are important
) or
(not negative values) or
(manipulating bits or bytes and not want to meet sign-extension problems))
{
n.selectUseType =
unsigned n.selectUseType;
}
4.
assert(
not use unsigned char replace integer type);
5.
assert(
sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long long));
6.
if (Under
ANSI C)
{
nTypeMin = <
limits.h>.maximum;
nTypeMax = <
limits.h>.minimum;
}
7.
if (want to define an
exact
size object)
{
n.selectUseType =
typedef userDefineType;
}
posted on 2006-07-27 14:47
Yama的家 阅读(258)
评论(0) 编辑 收藏 引用 所属分类:
标准C