I am using 3d arrays and i am trying to find the maximum size of a certain value inside of them but I keep getting errors when I am using 'sizeof'
Code:
#include < amxmodx >
enum _: enumfirst
{
enum1,
enum2,
enum3,
enum4
};
enum _: enumsecond
{
enumone,
enumtwo,
enumthree
};
new szHello[ enumfirst ][ enumsecond ][ ] =
{
{ "one", { 1, 2, 4 }, { 3,4 } },
{ "two", { 1, 2, 4 }, { 3,4 } },
{ "three", { 1, 2, 4 }, { 3,4 } },
{ "four", { 1, 2, 4 }, { 3,4 } }
};
public plugin_init()
{
register_plugin( "Plugin", "1.0", "Rejack" );
register_clcmd( "say /max", "CmdMax" );
}
public CmdMax( const index )
{
client_print( index, print_chat, "Sizeof: %i", sizeof szHello[ enum1 ][ enumtwo ] );
return PLUGIN_HANDLED;
}
Code:
Error: Expected token: "]", but found "-identifier-" on line 35
Warning: Expression has no effect on line 35
Error: Expected token: ";", but found "]" on line 35
Error: Invalid expression, assumed zero on line 35
Error: Too many error messages on one line on line 35
How can I check the size of the value ?
__________________