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

C / C++ / MFC

 
GeneralRe: LPTSTR problem Pin
Eytukan27-Mar-09 6:10
Eytukan27-Mar-09 6:10 
GeneralRe: LPTSTR problem Pin
Joe Woodbury27-Mar-09 6:19
professionalJoe Woodbury27-Mar-09 6:19 
GeneralRe: LPTSTR problem Pin
Eytukan27-Mar-09 6:26
Eytukan27-Mar-09 6:26 
GeneralRe: LPTSTR problem Pin
Joe Woodbury27-Mar-09 6:30
professionalJoe Woodbury27-Mar-09 6:30 
JokeRe: LPTSTR problem Pin
Eytukan27-Mar-09 6:41
Eytukan27-Mar-09 6:41 
GeneralRe: LPTSTR problem Pin
Joe Woodbury27-Mar-09 6:50
professionalJoe Woodbury27-Mar-09 6:50 
JokeRe: LPTSTR problem Pin
Eytukan27-Mar-09 6:53
Eytukan27-Mar-09 6:53 
General[OT] Re: LPTSTR problem Pin
David Crow27-Mar-09 6:45
David Crow27-Mar-09 6:45 
Joe Woodbury wrote:
...it accomplishes nothing.


Actually it does -- it correctly sets the first byte of that string to nul. The fact that it also initializes the rest of the string (which may or may not be a requirement) does not negate that.

Code that "accomplishes nothing" would resemble:

char *p = NULL; 
p = new char[100];
Joe Woodbury wrote:
And again, the problem was that you didn't phrase this as "this is a pointless habit of mine", but as something he "should" do.


One word does this to you? The word "should" is not one of those absolute words like "always" and "must" and "never." To say to someone, "You should put your coat on" is not the same as "You must put your coat on." While the latter might be the optimal suggestion, the former suggestion is simply one that is better than what's currently being done. Since the OP was doing no initialization at all, any suggestion could be qualified with "should" and be correct.

"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons


GeneralRe: [OT] Re: LPTSTR problem Pin
Joe Woodbury27-Mar-09 6:49
professionalJoe Woodbury27-Mar-09 6:49 
GeneralRe: [OT] Re: LPTSTR problem Pin
Eytukan27-Mar-09 6:49
Eytukan27-Mar-09 6:49 
GeneralRe: LPTSTR problem Pin
CPallini27-Mar-09 7:09
mveCPallini27-Mar-09 7:09 
GeneralRe: LPTSTR problem Pin
Joe Woodbury27-Mar-09 7:12
professionalJoe Woodbury27-Mar-09 7:12 
GeneralRe: LPTSTR problem Pin
CPallini27-Mar-09 7:25
mveCPallini27-Mar-09 7:25 
GeneralRe: LPTSTR problem Pin
Stuart Dootson27-Mar-09 1:48
professionalStuart Dootson27-Mar-09 1:48 
GeneralRe: LPTSTR problem Pin
Joe Woodbury27-Mar-09 5:51
professionalJoe Woodbury27-Mar-09 5:51 
GeneralRe: LPTSTR problem Pin
Stuart Dootson27-Mar-09 6:09
professionalStuart Dootson27-Mar-09 6:09 
GeneralRe: LPTSTR problem Pin
Joe Woodbury27-Mar-09 6:22
professionalJoe Woodbury27-Mar-09 6:22 
AnswerRe: LPTSTR problem Pin
CPallini27-Mar-09 0:49
mveCPallini27-Mar-09 0:49 
AnswerRe: LPTSTR problem Pin
Cedric Moonen27-Mar-09 0:51
Cedric Moonen27-Mar-09 0:51 
GeneralRe: LPTSTR problem Pin
zakkas248327-Mar-09 1:03
zakkas248327-Mar-09 1:03 
GeneralRe: LPTSTR problem Pin
CPallini27-Mar-09 1:10
mveCPallini27-Mar-09 1:10 
GeneralRe: LPTSTR problem Pin
zakkas248327-Mar-09 1:14
zakkas248327-Mar-09 1:14 
GeneralRe: LPTSTR problem Pin
Eytukan27-Mar-09 1:26
Eytukan27-Mar-09 1:26 
GeneralRe: LPTSTR problem Pin
zakkas248327-Mar-09 1:53
zakkas248327-Mar-09 1:53 
QuestionRe: LPTSTR problem [modified] Pin
CPallini27-Mar-09 1:44
mveCPallini27-Mar-09 1:44 

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.