Click here to Skip to main content
16,008,942 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How To Get know if Directory Exists? Pin
Michael Dunn10-Feb-05 10:16
sitebuilderMichael Dunn10-Feb-05 10:16 
GeneralHelp in adding a new display mode!!!Crazy Pin
uday__m9-Feb-05 23:15
uday__m9-Feb-05 23:15 
Questionhow to pack bitmaps in a dll Pin
Anonymous9-Feb-05 23:02
Anonymous9-Feb-05 23:02 
AnswerRe: how to pack bitmaps in a dll Pin
2249179-Feb-05 23:07
2249179-Feb-05 23:07 
GeneralUDP message reply Pin
Anonymous9-Feb-05 22:58
Anonymous9-Feb-05 22:58 
Generalsorting elements in double pointer Pin
tttyip9-Feb-05 20:35
tttyip9-Feb-05 20:35 
GeneralRe: sorting elements in double pointer Pin
David Crow10-Feb-05 9:26
David Crow10-Feb-05 9:26 
GeneralRe: sorting elements in double pointer Pin
tttyip22-Feb-05 2:32
tttyip22-Feb-05 2:32 
It seems not work.
What I want to do is to sort a double pointer which points to a array.
There is also an index pointer points to the index location, after I sort the data pointer, the index elements are rearrange according to the sorted data.

For example, I have a double pointer ptrdata.
double *ptrData = (double*)calloc(5, sizeof(double));
double *ptrIndex = double*)calloc(5, sizeof(double));

ptrData[0] = 3; ptrData[1] = 4; ptrData[2] = 2; ptrData[3] = 5;
ptrData[4] = 6;

ptrIndex[0] = 1; ptrIndex[1] = 2; ptrIndex[2] = 3; ptrIndex[3] = 4;
ptrIndex[4] = 5;

After sorting:
ptrData[0] = 2; ptrData[1] = 3; ptrData[2] = 4; ptrData[3] = 5;
ptrData[4] = 6;

ptrIndex[0] = 3; ptrIndex[1] = 1; ptrIndex[2] = 2; ptrIndex[3] = 4;
ptrIndex[4] = 5;


I know qsort can sort the elements quickly, but howcan I aso re-arrange the index with the use of qsort?


Thanks

GeneralRe: sorting elements in double pointer Pin
David Crow22-Feb-05 3:36
David Crow22-Feb-05 3:36 
GeneralVisual Studio .Net hangs system during debugging. Pin
Brian van der Beek9-Feb-05 20:03
Brian van der Beek9-Feb-05 20:03 
GeneralRe: Visual Studio .Net hangs system during debugging. Pin
2249179-Feb-05 21:34
2249179-Feb-05 21:34 
GeneralRe: Visual Studio .Net hangs system during debugging. Pin
Joel Lucsy13-Feb-05 14:29
Joel Lucsy13-Feb-05 14:29 
GeneralShellExecute, it is not working Pin
Aqueel9-Feb-05 19:17
Aqueel9-Feb-05 19:17 
GeneralRe: ShellExecute, it is not working Pin
Blake Miller10-Feb-05 4:46
Blake Miller10-Feb-05 4:46 
GeneralRe: ShellExecute, it is not working Pin
Aqueel10-Feb-05 16:31
Aqueel10-Feb-05 16:31 
GeneralRe: ShellExecute, it is not working Pin
Yulianto.10-Feb-05 16:48
Yulianto.10-Feb-05 16:48 
GeneralRe: ShellExecute, it is not working Pin
Blake Miller11-Feb-05 4:10
Blake Miller11-Feb-05 4:10 
QuestionHow to draw line control in .net design time using 2 points ? Pin
Surya Prakash Adari9-Feb-05 19:14
Surya Prakash Adari9-Feb-05 19:14 
GeneralHalf Heart- an MMORPG Pin
RageForInsanity9-Feb-05 19:12
RageForInsanity9-Feb-05 19:12 
GeneralRe: Half Heart- an MMORPG Pin
namaskaaram9-Feb-05 19:40
namaskaaram9-Feb-05 19:40 
GeneralRe: Half Heart- an MMORPG Pin
RageForInsanity9-Feb-05 21:09
RageForInsanity9-Feb-05 21:09 
GeneralRe: Half Heart- an MMORPG Pin
RageForInsanity9-Feb-05 21:11
RageForInsanity9-Feb-05 21:11 
GeneralRe: Half Heart- an MMORPG Pin
namaskaaram9-Feb-05 21:27
namaskaaram9-Feb-05 21:27 
GeneralRe: Half Heart- an MMORPG Pin
namaskaaram9-Feb-05 21:33
namaskaaram9-Feb-05 21:33 
GeneralCombobox Control at runtime Pin
Rahim Rattani9-Feb-05 18:57
Rahim Rattani9-Feb-05 18:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.