[Fixed] Small question concerning pointers.
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    Hi,

    I have a pointer to structure pointer defined as follow :
    struct ImageStruct ** ImageData;

    it contain a list of pointers to ImageData structures.
    I'd like to be sure that what follow is correct.

    if I define this :
    struct ImageStruct * MyImagePTR;

    Does :
    MyImagePTR = ImageData[ ElementN ];
    is correct ?
    Because, in my memory, it seem correct but it don't work.

    Thank you per advance,

    Kindest Regards,
    AmiDARK

    [ Edité par AmiDARK 17.12.2011 - 14:08 ]
  • »16.12.11 - 19:34
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Samurai_Crow
    Posts: 153 from 2009/12/10
    From: Minnesota, USA
    Ummm... Where is the allocation of the array of pointers?
  • »17.12.11 - 02:31
    Profile
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    I use a function to create the memory array of pointers ( like ImageData = AllocVec( Amount * sizeof ( * ), MEMF_CLEAR ); )
    the problem was not here.
    I have created 2 functions, 1 to write the image ptr, 2 to read it from the array.
    With a 2 nd local pointer that is a copy of the original memory pointer but shifted for the wanted Image slot.
    Now it work perfectly using these 2 functions :p
    Thank you :)
  • »17.12.11 - 14:08
    Profile Visit Website