[c/c++]unsigned和int的比较会默认强制转换为unsigned

/ 34,815评论 / 102590阅读 / 0点赞

无符号整形(unsigned) 和 有符号整形(int) 的比较会默认强制转换为 无符号类型(unsigned)

#include <iostream>
using namespace std;

int main()
{
	int a = -1;
	unsigned int b = 77;
	if (a > b)	//a > b  = true
		cout << "a > b" << endl;
	else
		cout << "a < b" << endl;
	cout << " a = " << a << endl;
	cout << " b = " << b << endl;
}
  1. HenryTor说道:

    dark web drug marketplace darknet sites

  2. RichardSpela说道:

    dark web drug marketplace onion market

  3. AlbertBof说道:

    how to get on dark web blackweb

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注