You're completely right and I had the same problem with my project! Only with hard looking in the online manual I found the solution.

"!! sizeof() is a macro and not a function. It can be used for setting a variable or passing a parameter to a function, but can not be used in expressions. Thus, long_size = sizeof(long); is ok, but long_size_times_ten = sizeof(long)*10; is not. "

http://manual.conitec.net/structs.htm


// allocate memory for 100 integers
int *array = (int *)malloc(100 * 4);

// initialize memory
memset(array, 0, 100 * 4);