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

C / C++ / MFC

 
GeneralAh, pointers... Pin
Shankar Chandra Bose26-Jun-01 20:05
Shankar Chandra Bose26-Jun-01 20:05 
GeneralRe: Ah, pointers... Pin
Michael Dunn26-Jun-01 21:28
sitebuilderMichael Dunn26-Jun-01 21:28 
GeneralRe: Ah, pointers... Pin
Shankar Chandra Bose26-Jun-01 21:48
Shankar Chandra Bose26-Jun-01 21:48 
QuestionWhy?? Pin
26-Jun-01 18:23
suss26-Jun-01 18:23 
AnswerRe: Why?? Pin
Frank Liao26-Jun-01 19:00
Frank Liao26-Jun-01 19:00 
GeneralRe: Why?? Pin
26-Jun-01 20:14
suss26-Jun-01 20:14 
GeneralRe: Why?? Pin
Michael Dunn26-Jun-01 21:32
sitebuilderMichael Dunn26-Jun-01 21:32 
GeneralRe: Why?? Pin
Frank Liao27-Jun-01 3:42
Frank Liao27-Jun-01 3:42 
Same Problem.

_TCHAR *str = _T("Astring");

is a pointer to a string constant. What you really want is

_TCHAR str[] = _T("Astring");

This will store the string into an array. Therefore, it allows _tcsrev (or now _wcsrev) to modify the array. Of course, I can't say that it's "ANSI C" because this is a MS-specific type.

Heh, it seems that the sample program is trying to get away with this business. In practice, you should never modify a pointer to a constant string. Smile | :)

Frank
AnswerRe: Why?? Pin
Rejeesh27-Jun-01 4:11
Rejeesh27-Jun-01 4:11 
QuestionHow Can convert BSTR to LPCSTR OR vice versa! Pin
bluestn26-Jun-01 17:10
bluestn26-Jun-01 17:10 
AnswerRe: How Can convert BSTR to LPCSTR OR vice versa! Pin
Christian Graus26-Jun-01 17:14
protectorChristian Graus26-Jun-01 17:14 
GeneralRe: How Can convert BSTR to LPCSTR OR vice versa! Pin
Venkat Raghavan26-Jun-01 17:28
Venkat Raghavan26-Jun-01 17:28 
AnswerRe: How Can convert BSTR to LPCSTR OR vice versa! Pin
Erik Thompson26-Jun-01 18:29
sitebuilderErik Thompson26-Jun-01 18:29 
GeneralRich Text (RichEdit) Tab Setting Pin
Steven Armstrong26-Jun-01 17:00
Steven Armstrong26-Jun-01 17:00 
GeneralCString to Integer Pin
PJ Arends26-Jun-01 16:56
professionalPJ Arends26-Jun-01 16:56 
GeneralRe: CString to Integer Pin
Michael Dunn26-Jun-01 18:04
sitebuilderMichael Dunn26-Jun-01 18:04 
GeneralRe: CString to Integer Pin
27-Jun-01 1:49
suss27-Jun-01 1:49 
GeneralUsing CDoc's data for a new document in MDI Pin
mr200326-Jun-01 16:05
mr200326-Jun-01 16:05 
GeneralRe: Using CDoc's data for a new document in MDI Pin
Christian Graus26-Jun-01 16:18
protectorChristian Graus26-Jun-01 16:18 
GeneralRe: Using CDoc's data for a new document in MDI Pin
mr200326-Jun-01 16:43
mr200326-Jun-01 16:43 
GeneralRe: Using CDoc's data for a new document in MDI Pin
Christian Graus26-Jun-01 17:03
protectorChristian Graus26-Jun-01 17:03 
GeneralTry this again Pin
Michael Martin26-Jun-01 15:43
professionalMichael Martin26-Jun-01 15:43 
GeneralRe: Try this again Pin
Christian Graus26-Jun-01 15:51
protectorChristian Graus26-Jun-01 15:51 
GeneralRe: Try this again Pin
26-Jun-01 16:20
suss26-Jun-01 16:20 
GeneralRe: Try this again Pin
Bret Faller27-Jun-01 7:21
Bret Faller27-Jun-01 7:21 

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.