什么是无符号数据types?
我已经看过这个unsigned “无types”types,但是从来没有看到过它的解释。 我想有一个相应的signedtypes。 这是一个例子: 
 static unsigned long next = 1; /* RAND_MAX assumed to be 32767 */ int myrand(void) { next = next * 1103515245 + 12345; return(( unsigned )(next/65536) % 32768); } void mysrand( unsigned seed ) { next = seed; } 
 我到目前为止收集到的: 
  – 在我的系统上, sizeof(unsigned) = 4 (提示32位无符号整数) 
  – 它可以用作将另一个types转换为未签名版本的简写forms: 
 signed long int i = -42; printf("%u\n", (unsigned)i); 
这是ANSI C,还是只是一个编译器扩展?
  unsigned是unsigned int的缩写,在标准C中定义。 
  unsigned表示unsigned int 。  signed手段signed int 。 只使用unsigned是在C中声明一个unsigned int的懒惰方式。是的,这是ANSI。 
历史上在C中,如果你省略了一个数据types“int”的话。 所以“unsigned”是“unsigned int”的缩写。 长期以来这被认为是不好的做法,但仍然有相当数量的代码使用它。
 在C中, unsigned是unsigned int的快捷键。 
 你long有相同的long int的快捷方式 
 还有可能声明一个unsigned long (它将是一个unsigned long int )。 
这是ANSI标准
在C和C ++中
 unsigned = unsigned int (Integer type) signed = signed int (Integer type) 
包含n位的无符号整数可以具有0到(2 ^ n-1)之间的值,这是2 ^ n个不同的值。
无符号整数是正数或零。
带符号的整数使用二进制补码存储在计算机中。
从另一个问题来回答我的答案 。
从C规范中 ,第6.7.2节:
– 无符号或无符号整数
 含义是unsigned ,当没有指定types时,默认为unsigned int 。 所以写unsigned a与unsigned int a相同。