Well, I'd like to keep it that way if I could.
But the ifsteam inputfile function chokes if I try to give it an std::string
Printable View
Well, I'd like to keep it that way if I could.
But the ifsteam inputfile function chokes if I try to give it an std::string
that's the "as long as you can" bit :D
use std::string like this
that should work.Code:bool MS3DModel::Load_MS3D_Model(const std::string &Filename)
{
ifstream inputFile( Filename.c_str(), ios::in | ios::binary | ios::nocreate );
// more code here!
}
Thats what I had in there about 10 posts ago :D
With the assert you mentioned:Code:bool MS3DModel::Load_MS3D_Model(const std::string &Filename)
{
assert(Filename.length() > 5 && Filename.substr(Filename.length() - 5) == ".ms3d");
ifstream inputFile( Filename.c_str(), ios::in | ios::binary | ios::nocreate );
// more code here!
}
Except you were creating a temporary.Quote:
Originally Posted by Shamino
And passing by value.
Yeah yeah :D, checkout the full system WIP, I posted about it..