Click here to Skip to main content
15,919,422 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to get input from user Pin
ns17-Sep-02 3:59
ns17-Sep-02 3:59 
QuestionBIG OR LITTLE QUESTION? Pin
ZBUILDER17-Sep-02 2:46
ZBUILDER17-Sep-02 2:46 
AnswerRe: BIG OR LITTLE QUESTION? Pin
jhwurmbach17-Sep-02 2:54
jhwurmbach17-Sep-02 2:54 
AnswerRe: BIG OR LITTLE QUESTION? Pin
Bart Robeyns17-Sep-02 2:57
Bart Robeyns17-Sep-02 2:57 
GeneralRe: BIG OR LITTLE QUESTION? Pin
ZBUILDER17-Sep-02 3:08
ZBUILDER17-Sep-02 3:08 
Questioncan Anybody tell me, how to resolve a trouble debug assert fail? Pin
Anonymous17-Sep-02 2:36
Anonymous17-Sep-02 2:36 
AnswerRe: can Anybody tell me, how to resolve a trouble debug assert fail? Pin
Bart Robeyns17-Sep-02 2:49
Bart Robeyns17-Sep-02 2:49 
GeneralIssues with char ** pointers Pin
Jon Hulatt17-Sep-02 2:18
Jon Hulatt17-Sep-02 2:18 
Hi,

This is really annoying me.

char *buffer;
GetData(&buffer);


the plan here is that the GetData function will allocate buffer:-

void GetData( char ** ppBuf)
{
  *ppBuf = new char [length];
  strcpy (*ppBuf,"other data");
}


this appears to work. In fact, back in the original code block:-

printf(buffer);


works correctly.

But when i try and delete the allocated memory in the original code block:-

delete [] buffer;


I get a nasty debug "damage after normal block" type error. Both the main block and the called function exist within the same thread. I've traced through step by step in the debugger, and the address of the block of memory that is allocated by the new keyword is definately the very same block of memory that i am trying to delete.

Why does this occur????

thanks,

Jon


STL is a religeon. Enquiries to Reverend Christian Graus
GeneralRe: Issues with char ** pointers Pin
Roger Allen17-Sep-02 2:27
Roger Allen17-Sep-02 2:27 
GeneralRe: Issues with char ** pointers Pin
Jon Hulatt17-Sep-02 2:31
Jon Hulatt17-Sep-02 2:31 
GeneralProject managment under Visual C++ Pin
auroch17-Sep-02 2:04
auroch17-Sep-02 2:04 
GeneralMs Word Automation, Disable Keyboard Input... Pin
Braulio Dez17-Sep-02 1:20
Braulio Dez17-Sep-02 1:20 
GeneralRe: Ms Word Automation, Disable Keyboard Input... Pin
Stephane Rodriguez.17-Sep-02 1:43
Stephane Rodriguez.17-Sep-02 1:43 
GeneralRe: Ms Word Automation, Disable Keyboard Input... Pin
Braulio Dez17-Sep-02 4:32
Braulio Dez17-Sep-02 4:32 
GeneralReading Disk device Pin
Anonymous17-Sep-02 0:38
Anonymous17-Sep-02 0:38 
GeneralAsynchronous Transfer Mode (ATM) Pin
EllieS17-Sep-02 0:07
EllieS17-Sep-02 0:07 
GeneralCString Pin
Gian17-Sep-02 0:01
Gian17-Sep-02 0:01 
GeneralRe: CString Pin
Gian17-Sep-02 0:05
Gian17-Sep-02 0:05 
GeneralRe: CString Pin
Alexandru Savescu17-Sep-02 1:57
Alexandru Savescu17-Sep-02 1:57 
GeneralRe: CString Pin
Gian17-Sep-02 3:12
Gian17-Sep-02 3:12 
GeneralUsing C++ code from C Pin
benjymous16-Sep-02 23:33
benjymous16-Sep-02 23:33 
GeneralRe: Using C++ code from C Pin
Alexandru Savescu17-Sep-02 3:25
Alexandru Savescu17-Sep-02 3:25 
GeneralRe: Using C++ code from C Pin
benjymous17-Sep-02 4:25
benjymous17-Sep-02 4:25 
GeneralRe: Using C++ code from C Pin
Paul M Watt17-Sep-02 6:21
mentorPaul M Watt17-Sep-02 6:21 
Questionhow to read mails from any server using VC++? Pin
Omar Lodhi16-Sep-02 23:33
Omar Lodhi16-Sep-02 23:33 

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.