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";
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.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
thanks i got it working now