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

C / C++ / MFC

 
QuestionTool tips on dialog buttons with no MFC? Pin
Kayembi8-Aug-03 9:13
Kayembi8-Aug-03 9:13 
AnswerRe: Tool tips on dialog buttons with no MFC? Pin
Michael Dunn8-Aug-03 10:23
sitebuilderMichael Dunn8-Aug-03 10:23 
GeneralRe: Tool tips on dialog buttons with no MFC? Pin
Kayembi8-Aug-03 12:13
Kayembi8-Aug-03 12:13 
GeneralRe: Tool tips on dialog buttons with no MFC? Pin
Michael Dunn9-Aug-03 6:51
sitebuilderMichael Dunn9-Aug-03 6:51 
GeneralRe: Tool tips on dialog buttons with no MFC? Pin
Kayembi10-Aug-03 3:34
Kayembi10-Aug-03 3:34 
Generaltelnet server/ TCP client Pin
lightyear8-Aug-03 8:59
lightyear8-Aug-03 8:59 
GeneralRe: telnet server/ TCP client Pin
Ryan Binns8-Aug-03 21:47
Ryan Binns8-Aug-03 21:47 
Questionmalloc ? Pin
_skidrow_vn_8-Aug-03 8:42
_skidrow_vn_8-Aug-03 8:42 
malloc ?


I want to allocate a memory block (such as 150 bytes) with all chars are initialize with "A"

this is my way:

char* p;
p=(char*)malloc(150)
//if( p == NULL )
// errhanlder("Insufficient memory available");
free(p);
// All okay but all chars are disorder, not "A"


but when I reset all chars in my string to "A" .....
ErrMessageBox is shown

char* p;
p=(char*)malloc(150)
//if( p == NULL )
// errhanlder("Insufficient memory available");
_strset('A'); // set all char to "A"
free(p); // Error in this line, if delete this line, it runs okay

Why when I try to free memory block, Error MessageBox show ?

>> when I debug , I get info:

// _msize(p) => return 150 but
// strlen(p) => return 154 ???????
// I try to set p+150 = 0x0(nullchar) but Error still show
// strcpy(p+150,0x0)

help me~

and is there a way to create StrArray[a][b] with a, b are variable
example :
StrArray[1][1] point to a string "hello"
StrArray[1][2] point to a string "bye"
StrArray[2][1] point to a string "good"
StrArray[2][2] point to a string "very long string ...."
........
thanks
AnswerRe: malloc ? Pin
Gary Kirkham8-Aug-03 8:56
Gary Kirkham8-Aug-03 8:56 
GeneralRe: malloc ? Pin
_skidrow_vn_8-Aug-03 9:03
_skidrow_vn_8-Aug-03 9:03 
GeneralRe: malloc ? Pin
David Crow8-Aug-03 9:33
David Crow8-Aug-03 9:33 
GeneralRe: malloc ? Pin
User 66588-Aug-03 9:44
User 66588-Aug-03 9:44 
GeneralRe: malloc ? Pin
Tim Smith8-Aug-03 13:10
Tim Smith8-Aug-03 13:10 
GeneralRe: malloc ? Pin
Gary Kirkham8-Aug-03 15:27
Gary Kirkham8-Aug-03 15:27 
AnswerRe: malloc ? Pin
Rick York8-Aug-03 12:38
mveRick York8-Aug-03 12:38 
GeneralVideo frame transmission Pin
Chikka8-Aug-03 8:39
Chikka8-Aug-03 8:39 
GeneralSave Changes to... screwing up in WinXP Pin
mcguile2578-Aug-03 8:31
mcguile2578-Aug-03 8:31 
GeneralRe: Save Changes to... screwing up in WinXP Pin
Neville Franks8-Aug-03 11:11
Neville Franks8-Aug-03 11:11 
GeneralRe: Save Changes to... screwing up in WinXP Pin
Joe Woodbury8-Aug-03 13:54
professionalJoe Woodbury8-Aug-03 13:54 
GeneralCreating a dialog when a user hits ctrl+g+d Pin
keegan8-Aug-03 8:25
keegan8-Aug-03 8:25 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
Maximilien8-Aug-03 8:47
Maximilien8-Aug-03 8:47 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
keegan8-Aug-03 9:00
keegan8-Aug-03 9:00 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
David Crow8-Aug-03 9:36
David Crow8-Aug-03 9:36 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
Richard Jones8-Aug-03 9:57
Richard Jones8-Aug-03 9:57 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
keegan8-Aug-03 10:04
keegan8-Aug-03 10:04 

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.