Click here to Skip to main content
15,905,614 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Template classes Pin
toxcct1-Sep-06 4:47
toxcct1-Sep-06 4:47 
AnswerRe: Template classes Pin
prasad_som31-Aug-06 22:44
prasad_som31-Aug-06 22:44 
AnswerRe: Template classes Pin
Anonymuos1-Sep-06 0:30
Anonymuos1-Sep-06 0:30 
GeneralRe: Template classes Pin
Waldermort1-Sep-06 1:44
Waldermort1-Sep-06 1:44 
AnswerRe: Template classes Pin
MayankT1-Sep-06 0:45
MayankT1-Sep-06 0:45 
GeneralRe: Template classes Pin
toxcct1-Sep-06 1:51
toxcct1-Sep-06 1:51 
AnswerRe: Template classes Pin
Michael Dunn1-Sep-06 5:57
sitebuilderMichael Dunn1-Sep-06 5:57 
QuestionQuestion about dynamically allocated memory Pin
Eikthrynir31-Aug-06 21:37
Eikthrynir31-Aug-06 21:37 
Hi!
I have a question about dynamically allocated memory, actually about cleaning that memory.
For example I compile and run this piece of code:

char *pString = NULL;
if ( (pString = new char [100]) == NULL )
  exit( EXIT_FAILURE );

... <--- Use pString

delete [] pString;


The question is how does the program know how much memory (how many bytes) to free (deallocate)? Isn't it compulsory to specify the number of bytes between the two brackets in order to be sure that it will free all the dynamically allocated memory? Confused | :confused:

Any suggestions would be greatly appreciated!
Thanks in advance!
AnswerRe: Question about dynamically allocated memory Pin
Stephen Hewitt31-Aug-06 21:43
Stephen Hewitt31-Aug-06 21:43 
AnswerRe: Question about dynamically allocated memory Pin
prasad_som31-Aug-06 22:21
prasad_som31-Aug-06 22:21 
AnswerRe: Question about dynamically allocated memory Pin
Hamid_RT31-Aug-06 22:48
Hamid_RT31-Aug-06 22:48 
GeneralRe: Question about dynamically allocated memory Pin
Cedric Moonen31-Aug-06 23:02
Cedric Moonen31-Aug-06 23:02 
GeneralRe: Question about dynamically allocated memory Pin
Hamid_RT1-Sep-06 1:02
Hamid_RT1-Sep-06 1:02 
GeneralRe: Question about dynamically allocated memory Pin
Cedric Moonen1-Sep-06 1:14
Cedric Moonen1-Sep-06 1:14 
GeneralRe: Question about dynamically allocated memory Pin
Hamid_RT1-Sep-06 1:32
Hamid_RT1-Sep-06 1:32 
Questionclrscr() Pin
Rajesh R Subramanian31-Aug-06 21:22
professionalRajesh R Subramanian31-Aug-06 21:22 
AnswerRe: clrscr() Pin
_AnsHUMAN_ 31-Aug-06 21:49
_AnsHUMAN_ 31-Aug-06 21:49 
GeneralRe: clrscr() Pin
toxcct31-Aug-06 22:20
toxcct31-Aug-06 22:20 
GeneralRe: clrscr() Pin
_AnsHUMAN_ 31-Aug-06 22:54
_AnsHUMAN_ 31-Aug-06 22:54 
QuestionGreek in CEdit control Pin
LeathurBoy31-Aug-06 20:48
LeathurBoy31-Aug-06 20:48 
AnswerRe: Greek in CEdit control Pin
ThatsAlok1-Sep-06 0:46
ThatsAlok1-Sep-06 0:46 
Questionicon files!! Pin
harsha_123431-Aug-06 20:34
harsha_123431-Aug-06 20:34 
QuestionRe: icon files!! Pin
Programm3r31-Aug-06 20:37
Programm3r31-Aug-06 20:37 
AnswerRe: icon files!! Pin
PJ Arends31-Aug-06 21:12
professionalPJ Arends31-Aug-06 21:12 
AnswerRe: icon files!! Pin
Hamid_RT31-Aug-06 22:16
Hamid_RT31-Aug-06 22:16 

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.