Click here to Skip to main content
15,887,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to add an extra ".rc" file other than existing ".rc" file in your project? Pin
John R. Shaw6-Oct-07 1:22
John R. Shaw6-Oct-07 1:22 
AnswerRe: how to add an extra ".rc" file other than existing ".rc" file in your project? Pin
Mark Salsbery6-Oct-07 7:38
Mark Salsbery6-Oct-07 7:38 
QuestionHow to get CPU temperature. Pin
Max++5-Oct-07 16:59
Max++5-Oct-07 16:59 
AnswerRe: How to get CPU temperature. Pin
aquawicket5-Oct-07 17:03
aquawicket5-Oct-07 17:03 
AnswerRe: How to get CPU temperature. Pin
Hamid_RT5-Oct-07 18:51
Hamid_RT5-Oct-07 18:51 
QuestionResizing a dynamic pointer array Pin
aquawicket5-Oct-07 16:56
aquawicket5-Oct-07 16:56 
AnswerRe: Resizing a dynamic pointer array Pin
Karismatic5-Oct-07 19:43
Karismatic5-Oct-07 19:43 
AnswerRe: Resizing a dynamic pointer array Pin
John R. Shaw6-Oct-07 1:42
John R. Shaw6-Oct-07 1:42 
I can barely begin to tell you what is wrong with that.

1) Use ‘vector’ and all your problems will go away.
2) If you must provided your own (do not double copy the data):
2.1) Allocate the new amount of space required.
2.2) Copy the old data to the new data space.
2.3) Free the old space.
2.4) Assign the pointer to the new space.

In C you would have another option (realloc) that if it failed, you would have to resort to (2) above, but I do not know a way to do that in C++.

P.S. delete[] n;


INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

GeneralRe: Resizing a dynamic pointer array Pin
aquawicket6-Oct-07 8:05
aquawicket6-Oct-07 8:05 
GeneralRe: Resizing a dynamic pointer array Pin
John R. Shaw6-Oct-07 12:46
John R. Shaw6-Oct-07 12:46 
QuestionHow do you get the ScrollBar Width Pin
littleGreenDude5-Oct-07 10:12
littleGreenDude5-Oct-07 10:12 
AnswerRe: How do you get the ScrollBar Width Pin
Mark Salsbery5-Oct-07 12:16
Mark Salsbery5-Oct-07 12:16 
Questionwhat is ENSURE_THROW? [modified] Pin
DreamMengJian5-Oct-07 6:25
DreamMengJian5-Oct-07 6:25 
QuestionShowWindow Command Problems Pin
Beaon5-Oct-07 6:02
Beaon5-Oct-07 6:02 
AnswerRe: ShowWindow Command Problems Pin
IMNOOPR5-Oct-07 6:22
IMNOOPR5-Oct-07 6:22 
GeneralRe: ShowWindow Command Problems Pin
Beaon5-Oct-07 7:14
Beaon5-Oct-07 7:14 
QuestionRe: ShowWindow Command Problems Pin
Mark Salsbery5-Oct-07 7:48
Mark Salsbery5-Oct-07 7:48 
AnswerRe: ShowWindow Command Problems Pin
Beaon5-Oct-07 8:06
Beaon5-Oct-07 8:06 
GeneralRe: ShowWindow Command Problems Pin
Mark Salsbery5-Oct-07 8:11
Mark Salsbery5-Oct-07 8:11 
GeneralRe: ShowWindow Command Problems Pin
Beaon5-Oct-07 8:31
Beaon5-Oct-07 8:31 
GeneralRe: ShowWindow Command Problems Pin
Mark Salsbery5-Oct-07 9:50
Mark Salsbery5-Oct-07 9:50 
GeneralRe: ShowWindow Command Problems Pin
Beaon5-Oct-07 10:57
Beaon5-Oct-07 10:57 
GeneralRe: ShowWindow Command Problems Pin
David Crow6-Oct-07 3:35
David Crow6-Oct-07 3:35 
GeneralRe: ShowWindow Command Problems Pin
Beaon7-Oct-07 8:36
Beaon7-Oct-07 8:36 
AnswerRe: ShowWindow Command Problems [modified] Pin
Beaon8-Oct-07 3:31
Beaon8-Oct-07 3:31 

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.