5bb Subj : Pointers + Stuff To : borland.public.cpp.borlandcpp From : Alistair Date : Sun Jul 04 2004 05:08 pm Hi, I am just learning out pointers and was trying to manage assigned memory: struct s_Something { void *data; int length; int datatype; //0 - image, 1 - wav, 2 - string, 3 - etc... bool temp; }; I can happily use this, e.g. s_Something mySomething; mySomething.data = malloc(80); mySomething.length = 80; then use it like dosummet(&mySomething); //in dosummet -> mySomething->data etc... Now, I create a few of these through out my app and it works fine, but here is where i am stuck. I want to create a pointer list, if its possible, e.g. s_Something *somethings[256]; and each something is a pointer to an object I have created like above. The reason is that I can then loop the somethings and free(mySomthingx.data). I only want the list for storing references to the objects so i can free them. I then pass the objects via pointers through functions etc to be used. so at the end of my main application loop I can loop the list of pointers, getting the objects using memory and then see if they are temp (temporary) and if so, i can free the memory. Can someone give me some idea how this can be done without a lot of technical speak, I am new to C++ and I would like to get an understanding without long words / phrases i dont yet understand! Thanks Alistair . 0