【问题标题】:What is an unsigned int in c? [duplicate]c中的无符号整数是什么? [复制]
【发布时间】:2018-04-30 10:38:29
【问题描述】:

我有一些代码需要学习,但我不明白什么是 unsigned int 以及它是如何工作的。

void print_all_sums(unsigned int n,double a[n])
{ // 1 <= n <= 30
   unsigned int i,j,mask;
   double s;

类似的东西。

【问题讨论】:

标签: c variables


【解决方案1】:

C 中的unsigned int 是一种具有非负值的数据类型。 (例如 0,1,2,3,4...)

【讨论】:

  • 0 也是有效值,但不是正数。
  • 我在一个简单的代码中尝试过,0 作为 unsigned int 工作。感谢@AntonH 的帮助。
猜你喜欢
  • 2011-04-09
  • 2012-11-16
  • 2016-02-17
  • 2011-09-18
  • 2017-09-06
  • 1970-01-01
  • 1970-01-01
  • 2023-04-08
  • 2011-01-18
相关资源
最近更新 更多