Is it not possible to use memset on an array of integers? I tried the following memset call and didn\'t get the correct integer values in the
Don't use memset to initialize anything else than single-byte data types.
At first sight, it might appear that it should work for initializing an int to 0 or -1 (and on many systems it will work), but then you're not taking into account the possibility that you might generate a trap representation, causing undefined behavior, or the fact that the integer representation is not necessarily two's complement.
The correct way to initialize an array of int to -1, is to loop over the array, and set each value explicitly.