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

C / C++ / MFC

 
GeneralRe: error code 183 Pin
Bill Wilson19-Mar-02 14:14
Bill Wilson19-Mar-02 14:14 
Generalbest way to replace items in a string Pin
tbbooher19-Mar-02 9:55
tbbooher19-Mar-02 9:55 
GeneralRe: best way to replace items in a string Pin
Mazdak19-Mar-02 10:27
Mazdak19-Mar-02 10:27 
GeneralRe: best way to replace items in a string Pin
Tim Smith19-Mar-02 10:43
Tim Smith19-Mar-02 10:43 
GeneralRe: best way to replace items in a string Pin
Nish Nishant19-Mar-02 13:36
sitebuilderNish Nishant19-Mar-02 13:36 
GeneralRe: best way to replace items in a string Pin
Tim Smith19-Mar-02 13:48
Tim Smith19-Mar-02 13:48 
GeneralRe: best way to replace items in a string Pin
tbbooher20-Mar-02 7:29
tbbooher20-Mar-02 7:29 
GeneralRe: best way to replace items in a string Pin
Tim Smith20-Mar-02 7:35
Tim Smith20-Mar-02 7:35 
LPTSTR is basically a "char *" in ANSI/MBCS mode and "wchar_t *" in UNICODE mode.

My code is basically exactly the same thing remove_if does. At the end of my loop, "pszOut" would be the same as your "i". My terminating the string with a 0 does what your erase does.

Mine is for C style strings and yours is for STL strings. Since your version doesn't do a lot of extra string copies they both perform very well. The only thing in the C string version is that you could roll the tolower into the loop.

This STL version looks good IMHO.

Tim Smith

I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
GeneralRe: best way to replace items in a string Pin
Tim Smith20-Mar-02 7:42
Tim Smith20-Mar-02 7:42 
GeneralRe: best way to replace items in a string Pin
Mazdak19-Mar-02 10:56
Mazdak19-Mar-02 10:56 
GeneralRe: best way to replace items in a string Pin
dazinith19-Mar-02 11:00
dazinith19-Mar-02 11:00 
GeneralRe: best way to replace items in a string Pin
Joaquín M López Muñoz19-Mar-02 11:50
Joaquín M López Muñoz19-Mar-02 11:50 
QuestionSuggestions on Using Grids? Pin
dazinith19-Mar-02 9:08
dazinith19-Mar-02 9:08 
AnswerRe: Suggestions on Using Grids? Pin
Tomasz Sowinski19-Mar-02 9:19
Tomasz Sowinski19-Mar-02 9:19 
AnswerRe: Suggestions on Using Grids? Pin
alex.barylski19-Mar-02 9:52
alex.barylski19-Mar-02 9:52 
GeneralRe: Suggestions on Using Grids? Pin
dazinith19-Mar-02 10:31
dazinith19-Mar-02 10:31 
QuestionDynamic array??? Possible??? Pin
19-Mar-02 8:25
suss19-Mar-02 8:25 
AnswerRe: Dynamic array??? Possible??? Pin
Paul M Watt19-Mar-02 8:42
mentorPaul M Watt19-Mar-02 8:42 
AnswerRe: Dynamic array??? Possible??? Pin
Tomasz Sowinski19-Mar-02 8:49
Tomasz Sowinski19-Mar-02 8:49 
AnswerRe: Dynamic array??? Possible??? Pin
Nemanja Trifunovic19-Mar-02 8:49
Nemanja Trifunovic19-Mar-02 8:49 
AnswerRe: Dynamic array??? Possible??? Pin
dazinith19-Mar-02 9:00
dazinith19-Mar-02 9:00 
GeneralRe: Dynamic array??? Possible??? Pin
Christian Graus19-Mar-02 10:22
protectorChristian Graus19-Mar-02 10:22 
QuestionHow to create global variable? Pin
19-Mar-02 7:49
suss19-Mar-02 7:49 
AnswerRe: How to create global variable? Pin
Carlos Antollini19-Mar-02 7:51
Carlos Antollini19-Mar-02 7:51 
AnswerRe: How to create global variable? Pin
Paul M Watt19-Mar-02 8:07
mentorPaul M Watt19-Mar-02 8:07 

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.