Original Post
This class is not this simple, but I've removed everything to keep it simple.
class KFileIO : public fstream
{
public:
template < class Type >
VOID Save(Type *Data,LONG Count=1)
{ write((BYTE*)Data,sizeof(Type)*Count); }
template < class Type >
VOID Load(Type *Data,LONG Count=1)
{ read((BYTE*)Data,sizeof(Type)*Count); }
};
.. then later in code..
struct KCell
{
LONG X,Y;
LONG W,H;
};
VOID Map::Save(...)
{
KCell Cell;
KFileIO File;
File.Open(...);
...
File.Save(&Cell);
...
File.Close();
} Everything seems to be saving/loading correctly, but I've messed with more than one thing at a time, and I'm not positive this is not the problem. The compiler is fine with finding the type of a pointer, right? Just because I pass the address of the structure, it doesn't prevent the compiler from creating the correct version of the function?
And this does create just a version of the function for the call, right? Not a version of the class?!
Thanks much for any help!
-Jiia
[edited by - Jiia on October 2, 2002 10:04:55 PM]