Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
cast truncates constant value
Remarks
A constant value is cast to a smaller type. The compiler performs the cast, which truncates data.
Example
The following example generates C4310:
// C4310.cpp
// compile with: /W4
int main()
{
long int a;
a = (char) 128; // C4310, use value 0-127 to resolve
}