Click here to Skip to main content
16,005,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGetting message map for dynamic controls Pin
Nitron14-Apr-04 3:57
Nitron14-Apr-04 3:57 
GeneralRe: Getting message map for dynamic controls Pin
PJ Arends14-Apr-04 5:55
professionalPJ Arends14-Apr-04 5:55 
GeneralRe: Getting message map for dynamic controls Pin
Nitron14-Apr-04 5:57
Nitron14-Apr-04 5:57 
GeneralRe: Getting message map for dynamic controls Pin
PJ Arends14-Apr-04 6:04
professionalPJ Arends14-Apr-04 6:04 
GeneralRe: freeing a char * in Ansi C Pin
Tim Smith14-Apr-04 3:56
Tim Smith14-Apr-04 3:56 
GeneralRe: freeing a char * in Ansi C Pin
John M. Drescher14-Apr-04 4:27
John M. Drescher14-Apr-04 4:27 
GeneralRe: freeing a char * in Ansi C Pin
kfaday14-Apr-04 4:36
kfaday14-Apr-04 4:36 
GeneralRe: freeing a char * in Ansi C Pin
toxcct14-Apr-04 4:18
toxcct14-Apr-04 4:18 
don't the following work ?

<font style="color:blue;">#include</font> <stdio.h>     <font style="color:green;">// printf(), scantf()</font>
<font style="color:blue;">#include</font> <stdlib.h>    <font style="color:green;">// malloc(), free()</font>
<font style="color:blue;">#define</font> MAX_WORD 51
 
<font style="color:blue;">int</font> main (<font style="color:blue;">void</font>) {
    <font style="color:blue;">char</font> nomarchc[MAX_WORD]; 
 
    printf(<font style="color:gray;">"insert file name:"</font>);
    scanf(<font style="color:gray;">"%50s"</font>, nomarchc);
 
    return 0;
}



your problem with free() can come from your
name=(char*)malloc((sizeof(char))*MAX_WORD);<br />
line, where you allocate a memory area, but you store it into name instead of nomarch...


TOXCCT >>> GEII power


GeneralRe: freeing a char * in Ansi C Pin
Prakash Nadar14-Apr-04 4:42
Prakash Nadar14-Apr-04 4:42 
GeneralRe: freeing a char * in Ansi C Pin
Paul Ranson14-Apr-04 4:48
Paul Ranson14-Apr-04 4:48 
GeneralRe: freeing a char * in Ansi C Pin
kfaday14-Apr-04 4:54
kfaday14-Apr-04 4:54 
GeneralApplication Error ! Pin
Anonymous14-Apr-04 3:11
Anonymous14-Apr-04 3:11 
GeneralRe: Application Error ! Pin
Cedric Moonen14-Apr-04 3:20
Cedric Moonen14-Apr-04 3:20 
GeneralRe: Application Error ! Pin
Anonymous14-Apr-04 3:30
Anonymous14-Apr-04 3:30 
GeneralRe: Application Error ! Pin
Maximilien14-Apr-04 3:53
Maximilien14-Apr-04 3:53 
GeneralRe: Application Error ! Pin
Nitron14-Apr-04 4:37
Nitron14-Apr-04 4:37 
QuestionVS 6.0 or VS 7.0?? Pin
Demian Panello14-Apr-04 3:10
Demian Panello14-Apr-04 3:10 
AnswerRe: VS 6.0 or VS 7.0?? Pin
David Crow14-Apr-04 3:33
David Crow14-Apr-04 3:33 
GeneralRe: VS 6.0 or VS 7.0?? Pin
Demian Panello14-Apr-04 4:06
Demian Panello14-Apr-04 4:06 
GeneralRe: VS 6.0 or VS 7.0?? Pin
basementman14-Apr-04 4:16
basementman14-Apr-04 4:16 
AnswerRe: VS 6.0 or VS 7.0?? Pin
_moved14-Apr-04 3:57
_moved14-Apr-04 3:57 
AnswerRe: VS 6.0 or VS 7.0?? Pin
Tim Smith14-Apr-04 3:59
Tim Smith14-Apr-04 3:59 
GeneralCListView Pin
packetlos14-Apr-04 2:27
packetlos14-Apr-04 2:27 
GeneralRe: CListView Pin
David Crow14-Apr-04 2:32
David Crow14-Apr-04 2:32 
GeneralRe: CListView Pin
packetlos14-Apr-04 3:01
packetlos14-Apr-04 3:01 

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.