Reading pathnames from registry

I am reading a pathname from the registry and storing it in a char*.  For example "C:\Winnt\file.txt" is stored in a char*.  Now, when I want to open up this file, the "\"'s are escape sequences so the stream that I am trying to open doesn't exist (C:Winntfile.txt).  So my question is how do I add the escape sequence "\" in front of the "\"'s already in the char*?  Is there a way when reading from the registry to automatically add these extra slashes?  If not, how can I search for the single slashes in the string?
TomMahieuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chensuCommented:
You are confused with the concept of escape sequences. You need to use escape sequences (double backslash \) only in your source code for the C++ compiler to recognize it. But it is stored as a single backslash \ internally.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TomMahieuAuthor Commented:
nevermind...
chensu... yeah i understood that...

but i have been programming too long today

a little tip - you need to build the path to the file before you try to open it...  ;)

time to go home...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.