RE: [Dev-C++] dynamic allocation and structs
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2002-10-25 14:09:44
|
> -----Original Message----- > From: Per Westermark [mailto:pw...@ia...] > Sent: Friday, October 25, 2002 5:06 PM > To: Ioannis Vranos > Cc: 'Dev-C++ Mailing List' > Subject: RE: [Dev-C++] dynamic allocation and structs > > As already posted, a compilable example with qsort. > qsort think the pointers are the elements, so the sort isn't > a problem. > All you have to think about in your compare function, is that > you don't > get pointers to your elements, but pointers to pointers to > your elements. (On second thought) You are right. :) This is what usually happens in C++ with list when sort(). In this way you have rapid copying when dealing with large struct objects. C00l. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys |