not 100% sure that std::string overloads the + operator but if it does, yes that's fine. if not, use the .append method.
also pass your strings by const reference, not by value. That's can be a lot of data to copy around. i.e.:
void Get_Sprites(const std::string &file_name, const std::string &file_ext, int n1);
-me
Passing a string into an load_bitmap() [Allegro]
Edited above code to include passing by const ref.. how does it look now?
haha, didn't see ya did that too.
Quote:Original post by Palidine
not 100% sure that std::string overloads the + operator but if it does, yes that's fine. if not, use the .append method.
also pass your strings by const reference, not by value. That's can be a lot of data to copy around. i.e.:
void Get_Sprites(const std::string &file_name, const std::string &file_ext, int n1);
-me
haha, didn't see ya did that too.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement