T
tuko
Hello kind people.
Can someone explain please the following code?
/* Create Storage Space For The Texture */
AUX_RGBImageRec *TextureImage[1]; /* Line 1*/
/* Set The Pointer To NULL */
memset(TextureImage,0,sizeof(void *)*1); /* Line 2*/
According to my knowledge in the first line
the TextureImage variable is declared as
an array of one pointer to AUX_RGBImageRec.
Here is my question.
I don't understand the second line at all.
Especially the sizeof(void *) *1 thing.
What does it mean?
The initialization of the array of Pointer
could be better like this
AUX_RGBImageRec *TextureImage[1] = {NULL};
Right? It has the same effect?
(I know the distinction, but let's assume
that NULL and 0 is translated as the same
thing for the moment.)
Many thanks for any help.
Can someone explain please the following code?
/* Create Storage Space For The Texture */
AUX_RGBImageRec *TextureImage[1]; /* Line 1*/
/* Set The Pointer To NULL */
memset(TextureImage,0,sizeof(void *)*1); /* Line 2*/
According to my knowledge in the first line
the TextureImage variable is declared as
an array of one pointer to AUX_RGBImageRec.
Here is my question.
I don't understand the second line at all.
Especially the sizeof(void *) *1 thing.
What does it mean?
The initialization of the array of Pointer
could be better like this
AUX_RGBImageRec *TextureImage[1] = {NULL};
Right? It has the same effect?
(I know the distinction, but let's assume
that NULL and 0 is translated as the same
thing for the moment.)
Many thanks for any help.