Click here to Skip to main content
15,902,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple C to C++ Pin
Software200714-Sep-11 9:28
Software200714-Sep-11 9:28 
GeneralRe: Simple C to C++ Pin
Chris Losinger14-Sep-11 9:36
professionalChris Losinger14-Sep-11 9:36 
GeneralRe: Simple C to C++ [modified] Pin
Software200714-Sep-11 9:49
Software200714-Sep-11 9:49 
GeneralRe: Simple C to C++ Pin
David Crow14-Sep-11 10:09
David Crow14-Sep-11 10:09 
GeneralRe: Simple C to C++ Pin
Software200714-Sep-11 10:13
Software200714-Sep-11 10:13 
GeneralRe: Simple C to C++ Pin
Chris Losinger14-Sep-11 10:16
professionalChris Losinger14-Sep-11 10:16 
GeneralRe: Simple C to C++ [modified] Pin
Software200714-Sep-11 10:21
Software200714-Sep-11 10:21 
GeneralRe: Simple C to C++ Pin
Chris Losinger14-Sep-11 10:38
professionalChris Losinger14-Sep-11 10:38 
how about a generic std::string find/replace fn:

void repl2(std::string &str, const char *find, const char *repl)
{
// should probably quit if either of these are 0!
   size_t findLen = strlen(find);
   size_t replLen = strlen(repl);

   size_t index = 0;
   while (true) {
      /* Locate the substring to replace. */
      index = str.find(find, index);
      if (index == std::string::npos) break;

      /* Make the replacement. */
      str.replace(index, findLen, repl);

      /* Advance index forward so the next iteration doesn't pick it up as well. */
      index+=replLen;
   }
}



that's based on something from this thread[^].

GeneralRe: Simple C to C++ Pin
Chuck O'Toole14-Sep-11 14:54
Chuck O'Toole14-Sep-11 14:54 
GeneralRe: Simple C to C++ Pin
Chuck O'Toole14-Sep-11 14:13
Chuck O'Toole14-Sep-11 14:13 
AnswerRe: Simple C to C++ Pin
Chuck O'Toole14-Sep-11 14:08
Chuck O'Toole14-Sep-11 14:08 
AnswerRe: Simple C to C++ Pin
Chuck O'Toole14-Sep-11 14:32
Chuck O'Toole14-Sep-11 14:32 
AnswerRe: Simple C to C++ Pin
enhzflep14-Sep-11 16:21
enhzflep14-Sep-11 16:21 
GeneralRe: Simple C to C++ Pin
Chuck O'Toole14-Sep-11 17:18
Chuck O'Toole14-Sep-11 17:18 
AnswerRe: Simple C to C++ Pin
Erudite_Eric14-Sep-11 20:41
Erudite_Eric14-Sep-11 20:41 
AnswerRe: Simple C to C++ Pin
Richard MacCutchan14-Sep-11 22:14
mveRichard MacCutchan14-Sep-11 22:14 
GeneralRe: Simple C to C++ Pin
Orjan Westin15-Sep-11 1:38
professionalOrjan Westin15-Sep-11 1:38 
GeneralRe: Simple C to C++ Pin
Richard MacCutchan15-Sep-11 1:43
mveRichard MacCutchan15-Sep-11 1:43 
AnswerRe: Simple C to C++ Pin
Orjan Westin15-Sep-11 1:32
professionalOrjan Westin15-Sep-11 1:32 
AnswerRe: Simple C to C++ Pin
Stefan_Lang15-Sep-11 1:43
Stefan_Lang15-Sep-11 1:43 
GeneralRe: Simple C to C++ Pin
Richard MacCutchan15-Sep-11 1:47
mveRichard MacCutchan15-Sep-11 1:47 
JokeRe: Simple C to C++ Pin
MicroVirus15-Sep-11 3:36
MicroVirus15-Sep-11 3:36 
QuestionMFC OpenGL Invalidate Flickering Pin
appollosputnik14-Sep-11 6:19
appollosputnik14-Sep-11 6:19 
AnswerRe: Flicker Free Drawing In MFC Pin
Software_Developer14-Sep-11 7:32
Software_Developer14-Sep-11 7:32 
AnswerRe: MFC OpenGL Invalidate Flickering Pin
Roger Allen27-Sep-11 6:23
Roger Allen27-Sep-11 6:23 

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.