no error and print four time in game.
PHP Code:
enum chancetype
{
chance_a = 0,
chance_b,
chance_c,
chance_total
};
enum struct Eplayer
{
float a;
float chance[view_as<chancetype>(chance_total)];
}
public void OnClientPutInServer(int client)
{
if( IsFakeClient(client) )
return;
Eplayer a;
for(int i = 0; i <= sizeof( a.chance ); i++)
{
PrintToChat(client,"sizeof : %d",i);
}
}
and this is in wiki.
To allow implicit conversions of enums back to integers (that is, so functions expecting a value of type 'int' accepts it as one instead of generating a warning), the enum must either be anonymous (unnamed) or must start with a lowercase character.
so if you want to use an enum as an array size, don't set it's name or just use lowercas character in start.