Passing a string into an load_bitmap() [Allegro]

Started by
10 comments, last by Lempface 17 years, 10 months ago
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
Advertisement
Edited above code to include passing by const ref.. how does it look now?

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.
http://lempface.blogspot.com/Read about the RogueLike I'm Developing at my blog!

This topic is closed to new replies.

Advertisement