Code: Select all
stringc PlayerName;
PlayerName = "Niko Gebhardt";
//open file blah blah blah
o_file <<PlayerName;
//then close the file blah blah
no match for `std::ofstream& << irr::core::stringc&' operator
Someone got a way around this?
Code: Select all
stringc PlayerName;
PlayerName = "Niko Gebhardt";
//open file blah blah blah
o_file <<PlayerName;
//then close the file blah blah
Code: Select all
char[256] PlayerName;
strcpy(PlayerName,"Niko Gebhardt");
//open file blah blah blah
o_file << PlayerName;
//then close the file blah blah
ERRORS
player.h
declaration does not declare anything
player.h
parse error before `[' token
player.cpp
no match for `std::ofstream& << irr::core::stringc&' operator
There're some of my errors... (the main ones, others just come up because of those... you know how C++ is =P )Info Needed, which is inside the .H and .CPP files.
char[256] PlayerName;
strcpy(PlayerName,"Niko Gebhardt");
//--pieces taken from the SaveGame function.
ofstream o_file("save/game01.sav",ios::trunc);
o_file <<PlayerName;
o_file.close();
You can also get a pointer to a C or C++ style char from a stringc if you like:rt wrote:use a char[256] instead of a stringc
Code: Select all
stringc PlayerName;
PlayerName = "DarkWhoppy";
o_file <<PlayerName.c_str();