how do i pull something like this off?
so when i detect someone has completed a level i can just change the value of 'level' and repeat the same method.Code:int level = 1;
std::ifstream map("level" + level + ".map";
Printable View
how do i pull something like this off?
so when i detect someone has completed a level i can just change the value of 'level' and repeat the same method.Code:int level = 1;
std::ifstream map("level" + level + ".map";
Use a string stream to construct your filename.
Then use the c_str() method on that object to pass to ifstream as the filename to open.
thanks i got it working now :)