Click here to Skip to main content
15,913,196 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: differentiating between literal strings and char pointers Pin
dburns3-Aug-07 5:48
dburns3-Aug-07 5:48 
GeneralRe: differentiating between literal strings and char pointers Pin
David Crow3-Aug-07 6:11
David Crow3-Aug-07 6:11 
GeneralRe: differentiating between literal strings and char pointers Pin
dburns3-Aug-07 6:22
dburns3-Aug-07 6:22 
GeneralRe: differentiating between literal strings and char pointers Pin
led mike3-Aug-07 7:16
led mike3-Aug-07 7:16 
GeneralRe: differentiating between literal strings and char pointers Pin
David Crow3-Aug-07 7:18
David Crow3-Aug-07 7:18 
GeneralRe: differentiating between literal strings and char pointers Pin
led mike3-Aug-07 7:15
led mike3-Aug-07 7:15 
QuestionRe: differentiating between literal strings and char pointers Pin
David Crow3-Aug-07 5:10
David Crow3-Aug-07 5:10 
AnswerRe: differentiating between literal strings and char pointers Pin
dburns3-Aug-07 5:43
dburns3-Aug-07 5:43 
David,

DavidCrow wrote:
Why use p_buff when you can pass buff directly to the foo() method?


I could have passed buff in directly, yes. What I was trying to illustrate is that the input parameter might actually be a const char* pointer, but in that case I don't know where the underlying data came from. It could be from a buffer, as in the example, so I would have to copy the data in this case.

Unfortunately, a "quoted string" is also a const char* pointer, so it would naturally choose the same overridden foo. But if it's a "quoted string" then I don't have to copy the underlying data, so the goal is to differentiate between these two cases.

Like I said, probably not possible in C++, just checking.

DB
AnswerRe: differentiating between literal strings and char pointers Pin
cp98763-Aug-07 18:30
cp98763-Aug-07 18:30 
GeneralRe: differentiating between literal strings and char pointers Pin
dburns4-Aug-07 4:05
dburns4-Aug-07 4:05 
Questionproblem with radio button and UpdateData Pin
m.dietz3-Aug-07 4:13
m.dietz3-Aug-07 4:13 
AnswerRe: problem with radio button and UpdateData Pin
led mike3-Aug-07 4:52
led mike3-Aug-07 4:52 
GeneralRe: problem with radio button and UpdateData Pin
m.dietz5-Aug-07 20:11
m.dietz5-Aug-07 20:11 
GeneralRe: problem with radio button and UpdateData Pin
led mike6-Aug-07 5:29
led mike6-Aug-07 5:29 
AnswerRe: problem with radio button and UpdateData Pin
David Crow3-Aug-07 5:07
David Crow3-Aug-07 5:07 
GeneralRe: problem with radio button and UpdateData Pin
m.dietz5-Aug-07 20:28
m.dietz5-Aug-07 20:28 
GeneralRe: problem with radio button and UpdateData Pin
David Crow6-Aug-07 2:56
David Crow6-Aug-07 2:56 
GeneralRe: problem with radio button and UpdateData Pin
m.dietz6-Aug-07 20:43
m.dietz6-Aug-07 20:43 
AnswerRe: problem with radio button and UpdateData Pin
Hans Dietrich3-Aug-07 7:57
mentorHans Dietrich3-Aug-07 7:57 
GeneralRe: problem with radio button and UpdateData [modified] Pin
m.dietz5-Aug-07 20:20
m.dietz5-Aug-07 20:20 
QuestionRetrieve the length of an int Pin
Perspx3-Aug-07 4:02
Perspx3-Aug-07 4:02 
AnswerRe: Retrieve the length of an int Pin
Rage3-Aug-07 4:11
professionalRage3-Aug-07 4:11 
GeneralRe: Retrieve the length of an int Pin
Perspx3-Aug-07 4:14
Perspx3-Aug-07 4:14 
GeneralRe: Retrieve the length of an int Pin
David Crow3-Aug-07 4:22
David Crow3-Aug-07 4:22 
GeneralRe: Retrieve the length of an int Pin
LordMarv3-Aug-07 4:34
LordMarv3-Aug-07 4:34 

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.