c++中4309错误是什么错误?

来源:百度知道 编辑:UC知道 时间:2024/09/20 08:53:57

Windows系统错误中,4309的代号为ERROR_RESOURCE_DISABLED,表示A resource required for this operation is disabled,即,该操作所需的资源被禁用。

================================

C4309,编译器警告,表明常数值被截断。

特定的类型转换操作导致常量超出被分配的空间,需要使用更大的数据类型来保存该常量。

如:
char c = 128; // char为8位,取值范围-128~127

附:MSDN原文
--------------------

Compiler Warning (level 2) C4309
'conversion' : truncation of constant value

The specified type conversion operation caused a constant to exceeded the space allocated for it.

It may be necessary to use a larger type to contain the constant.

The following example causes this warning:

char c = 128; // warning
char x = (char) 128; // warning

在VC++6.0中是"这个操作所需的资源已禁用。"