#if !defined MAX_ARRAY_SIZE
const MAX_ARRAY_SIZE = 10;
#endif
static g_array[MAX_ARRAY_SIZE];
stock SetArray(const arr[], const source_size = sizeof(arr), const max_size = MAX_ARRAY_SIZE)
{
if (source_size >= max_size)
{
return 0;
}
memcpy(g_array
, arr
, _, source_size
* (cellbits / charbits)); return 1;
}
main()
{
new arr[11] = { 256, 512 };
new ret = SetArray(arr);
if (ret == 0)
{
printf("SetArray is ret 0 (source size (%d) >= max_size(%d)", sizeof(arr
), MAX_ARRAY_SIZE
); return 0;
}
for (new i = 0; i < sizeof(g_array); i++)
{
printf("g_array: %d", g_array
[i
]); }
}