Link to home
Start Free TrialLog in
Avatar of TomMahieu
TomMahieu

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TomMahieu
TomMahieu

ASKER

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...