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

/ 34,815评论 / 102935阅读 / 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. I’ve been browsing online more than three hours lately,
    yet I by no means discovered any attention-grabbing article like yours.
    It is lovely price enough for me. Personally, if all webmasters and bloggers made good content material as you probably did, the internet shall be a lot more
    useful than ever before.

  2. astro-wiki.win说道:

    I do not know whether it’s just me or if perhaps everybody else encountering issues
    with your website. It appears as though some of the written text on your posts are running off the screen. Can someone else please provide feedback and let me know if
    this is happening to them as well? This could be a problem with
    my browser because I’ve had this happen previously.
    Thanks

  3. wiki.natlife.ru说道:

    What’s up friends, fastidious piece of writing and fastidious arguments
    commented at this place, I am really enjoying by these.

  4. Bruce说道:

    Thank you for the auspicious writeup. It in fact was
    a amusement account it. Look advanced to far added agreeable
    from you! However, how can we communicate?

  5. Siempre que haya una red, puede grabar en tiempo real de forma remota, sin instalación de hardware especial.

  6. HenryTor说道:

    bitcoin dark web dark web market darknet markets links

  7. JamesCoigo说道:

    darknet markets dark markets how to access dark web

  8. HenryTor说道:

    dark web market dark web search engines darknet seiten

  9. JamesCoigo说道:

    deep dark web dark market url darknet market

  10. HenryTor说道:

    deep web drug links dark web market links darkmarket 2024

  11. Kevinglics说道:

    darknet links https://alldarkwebmarkets.com/ – darknet markets darkmarket url

发表回复

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