C++ (-1)this is a problem

  • In the recent project, the judgment condition of the for loop appeared -1. A strange problem appeared.

int a = 0;

int b = 1;

cout << a - b;

result : ----------->    18446744073709551615

  • I really hadn't thought of that problem.If you have a good solution, please let me know.

  • Thank you very much for your guidance

I hope I can help you,If you have any questions, please  comment on this blog or send me a private message. I will reply in my free time.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章