Why is a negative size_t underflowing but subtracting it does not?

前端 未结 0 965
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-15 00:23

I have this simple program here which is returning 18446744073709551615:

#include 

using namespace std;

int main()
{
    cout<<-(size_t)1;         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题