Your malloc call is totally wrong and is a perfect example of why you shouldn't cast the return of malloc(); not to mention the size calculation is wrong.
Secondly, please do not post PICTURES of your code. Just post the damn code in [code] tags.
Aside:
Why the hell are you taking 'ArraySize' as a parameter to your function, but immediately discarding it and setting it to 1000? Hoping that is just debugging or something..
Here is how you should be allocating your struct array:
Code:
struct MyStruct2 * ArrayPointer;
ArrayPointer = malloc(sizeof *ArrayPointer * ArraySize);
/* Or my personal favorite as it initialize the array of pointers to zero.. */
ArrayPointer = calloc(sizeof *ArrayPointer, ArraySize);