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

/ 36,825评论 / 141098阅读 / 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. KennethCex说道:

    how to buy amoxycillin Amox Star buy amoxicillin 500mg capsules uk

  2. SamuelDarse说道:

    cipro: ci pharm delivery – where to buy cipro online

发表回复

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