RAD Studio
ContentsIndex
PreviousUpNext
Initializing enumeration with type (C++)

You're trying to initialize an enum variable to a different type. For example,

enum count { zero, one, two } x = 2;

will result in this warning, because 2 is of type int, not type enum count. It is better programming practice to use an enum identifier instead of a literal integer when assigning to or initializing enum types. 

This is an error, but is reduced to a warning to give existing programs a chance to work.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!