Solved

char Replace

Posted on 2006-11-30
2
218 Views
Last Modified: 2013-11-20
Hi guys,

I have this variable:

char TargetPath[500];

I want to search it for "/"
and replace them with "\"

Anyone able to help me out please?

Cheers!
0
Comment
Question by:Cyber-Drugs
2 Comments
 
LVL 14

Accepted Solution

by:
wayside earned 500 total points
ID: 18048835
Well, you could put it into a CString and then use the .Replace function. :)

Otherwise you could do this:

int len = strlen(TargetPath);

for (int i=0; i<len; i++) {
  if (TargetPath[i] == '/')
   TargetPath[i] = '\\';
}
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18049013
Haha, valid point, cheers wayside! :)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 110
ORA-01403: no data found 43 83
EvenOdd challenge 10 83
wordmultiple challenge 12 92
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now