Click here to Skip to main content
15,892,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: strlen and char* Pin
User 66581-Oct-02 5:38
User 66581-Oct-02 5:38 
GeneralRe: strlen and char* Pin
jmkhael1-Oct-02 5:42
jmkhael1-Oct-02 5:42 
GeneralRe: strlen and char* Pin
Daniel Turini1-Oct-02 6:00
Daniel Turini1-Oct-02 6:00 
Generalstrcpy and CString question Pin
ns1-Oct-02 4:34
ns1-Oct-02 4:34 
GeneralRe: strcpy and CString question Pin
Nish Nishant1-Oct-02 4:46
sitebuilderNish Nishant1-Oct-02 4:46 
GeneralRe: strcpy and CString question Pin
ns1-Oct-02 4:52
ns1-Oct-02 4:52 
GeneralRe: strcpy and CString question Pin
Michael Dunn1-Oct-02 5:17
sitebuilderMichael Dunn1-Oct-02 5:17 
GeneralRe: strcpy and CString question Pin
Jon Hulatt1-Oct-02 5:30
Jon Hulatt1-Oct-02 5:30 
Michael Dunn wrote:
The correct way to get a non-const pointer is GetBuffer().

Yeah, but ns only wanted a const char *.

To fiddle around with GetBuffer() is unnecessary here, why force CString to allocate new memory when he's only reading it?

But, more to the point, the whole idea of "converting" the CString to char * is a bit fruitless. You can interchange CString operator char * and CString::GetBuffer entirely for read and write operations that need char *, and this will be quicker than what amounts to doing everything twice, not to mention obfuscates the code.

Jon

Signature space for rent. Apply by email to....
GeneralRe: strcpy and CString question Pin
Jon Hulatt1-Oct-02 5:35
Jon Hulatt1-Oct-02 5:35 
GeneralRe: strcpy and CString question Pin
Nitron1-Oct-02 5:31
Nitron1-Oct-02 5:31 
GeneralRe: strcpy and CString question Pin
Nish Nishant1-Oct-02 5:38
sitebuilderNish Nishant1-Oct-02 5:38 
GeneralRe: strcpy and CString question Pin
JT Anderson1-Oct-02 5:41
JT Anderson1-Oct-02 5:41 
GeneralRe: strcpy and CString question Pin
Nish Nishant1-Oct-02 5:54
sitebuilderNish Nishant1-Oct-02 5:54 
GeneralRe: strcpy and CString question Pin
Michael Dunn1-Oct-02 7:48
sitebuilderMichael Dunn1-Oct-02 7:48 
GeneralRe: strcpy and CString question Pin
Rene De La Garza1-Oct-02 10:39
Rene De La Garza1-Oct-02 10:39 
GeneralRe: strcpy and CString question Pin
Michael Dunn1-Oct-02 14:07
sitebuilderMichael Dunn1-Oct-02 14:07 
GeneralRe: strcpy and CString question Pin
Rene De La Garza1-Oct-02 16:27
Rene De La Garza1-Oct-02 16:27 
GeneralRe: strcpy and CString question Pin
Ravi Bhavnani1-Oct-02 5:27
professionalRavi Bhavnani1-Oct-02 5:27 
GeneralRe: strcpy and CString question Pin
Jon Hulatt1-Oct-02 5:34
Jon Hulatt1-Oct-02 5:34 
GeneralRe: strcpy and CString question Pin
Ravi Bhavnani1-Oct-02 6:54
professionalRavi Bhavnani1-Oct-02 6:54 
GeneralRe: strcpy and CString question Pin
Michael Dunn1-Oct-02 7:50
sitebuilderMichael Dunn1-Oct-02 7:50 
GeneralDocument/View startup problem Pin
will13831-Oct-02 4:32
will13831-Oct-02 4:32 
GeneralRe: Document/View startup problem Pin
Tomasz Sowinski1-Oct-02 5:58
Tomasz Sowinski1-Oct-02 5:58 
GeneralRe: Document/View startup problem Pin
will13831-Oct-02 6:46
will13831-Oct-02 6:46 
GeneralRe: Document/View startup problem Pin
Tomasz Sowinski1-Oct-02 6:55
Tomasz Sowinski1-Oct-02 6:55 

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.