长期比较

MOH*_*MED 0 c long-integer

我有以下代码

long x;
scanf("%ld",&x)
if(x==-1) // does this comparison is allowed
    printf("just test\n");
Run Code Online (Sandbox Code Playgroud)

long的参数需要比较之前的任何铸造?

Kir*_*rov 7

-1是小数int.有一个从隐式转换(促销)intlong,所以-1自动"铸造"来long.

此外,双方-1x签署类型.不需要任何额外的演员阵容.