replacing characters in C++[SOLVED]

Started by
6 comments, last by namingway 15 years, 10 months ago
i have a system to load files in a directory using boost however it loads them like this, Graphics\Icons\file.png I need them to be Graphics/Icons/file.png to load correctly, what would be the best way to do this? [Edited by - namingway on June 22, 2008 8:15:47 AM]
Advertisement
Use boost::filesystem::path.
thats exactly what im using but its putting the / the wrong way.
What platform are you using?
windows xp, after looking at it somemore it seems to be here where it changes
for (int i = 0; i < _iconFiles.size(); i++)
_iconNames.push_back(_iconFiles.file_string());
this is where it switchs from / to \ for some reason.

[Edited by - namingway on June 22, 2008 7:41:12 AM]
Windows uses backslashes for its file paths.
You are not doing something stupid like this, are you?
char* string = "Graphics\Icons\file.png"

Because you have to escape the backslahes:
char* string = "Graphics\\Icons\\file.png"
i figured out the problem thanks for trying :)

This topic is closed to new replies.

Advertisement