Ron Kochanowicz
2005-10-13 07:22:40 UTC
Hello,
I have a TEdit control on my form called CWID.
Upon a button event, I do the following:
char* CWIDPtr = CWID->Text.c_str();
I understand c_str() to return a null terminated char array.
However, I'm finding something very strange going on. If CWID->Text =
"BIGTIME", what is returned is actually to the CWIDPtr is "BIGT\x14".
During run-time if I break on the actual line char *CWIDPtr =
CWID->Text.c_str() and then single step through the operation in "dstring.h"
I get returned the correct null terminated array: "BIGTIME"
I'm at a loss. Any idea what's going on and why the c_str() routine only
returns the correct value when I single step through the c_str() construct??
TIA,
Ron
I have a TEdit control on my form called CWID.
Upon a button event, I do the following:
char* CWIDPtr = CWID->Text.c_str();
I understand c_str() to return a null terminated char array.
However, I'm finding something very strange going on. If CWID->Text =
"BIGTIME", what is returned is actually to the CWIDPtr is "BIGT\x14".
During run-time if I break on the actual line char *CWIDPtr =
CWID->Text.c_str() and then single step through the operation in "dstring.h"
I get returned the correct null terminated array: "BIGTIME"
I'm at a loss. Any idea what's going on and why the c_str() routine only
returns the correct value when I single step through the c_str() construct??
TIA,
Ron