I want to check if a defined struct has been initialized So i thaught of using
typedef struct
{
int *isInitialized;
} Thing;
int main()
{
Thing a;
//Only if initialized, should always fail now
if (a.isInitialized == NULL)
{
//Code
}
//I'm saying a is initialized
a.isInitialized = NULL;
}
Will this work or is there any (even small) chance the pointer will automatically be assigned to NULL when declaring a?
EDIT: I know it is not always NULL. I'm asking if it is ever NULL or will it always be some random not-NULL pointer