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

前端 未结 0 1974
花落未央
花落未央 2021-02-15 00:38

I have this simple program here which is returning 18446744073709551615:

#include 

using namespace std;

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


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