If you have an array of structs, then there are no pointers, so it doesn't make sense to check for null.
An array of n structs is literally n of those structs laid out one after the other in memory.
Could you change it to an array of pointers to structs, initialise them all to NULL, and create them as you need them? I'd be looking into why you want to check for null though first - it feels like you're doing something wrong.
(Edit for code added to question)
You don't show how you define testArray, but I suspect you've done the following:
Test testArray[testCount];
If you really need to compare against null, try the following:
Test *testArray[testCount];
for (int i = 0; i < testCount; i++)
{
testArray[i] = new Test;
}
At this point, none of the entries will be NULL, but if later in your code you do something like:
testArray[3] = NULL;
then you'll be able to detect that with the loop you provided in your question.
Can you clarify why you want to compare with NULL?
(And it keeps growing again - this time to address question regarding initialisation):
As others have mentioned, comparing with NULL is not a valid way of telling if something is initialised or not. Probably the best way forward is to write your code in such a way that you guarantee it will be initialised.
Probably the best way to do this is to put a default constructor on your Test struct (you can do this in C++, but not C). Something like:
struct A {
int x;
A() : x(0) { }
};
will do the job just fine. Now all of the structs in your array are guaranteed to exist, and be initialised with their x value set to 0.