Stringtable?!
by Matt Harpold · in General Game Discussion · 04/02/2004 (1:33 am) · 1 replies
Does this work for anybody?
const char *Str;
STRINGTABLE Stringtable;
Stringtable.Load("mitch.txt");
Str = Stringtable.GetString(3);
Specifically, when trying to specify an external file as my source for the method 'Load', I get the following charming error:
error C2664: 'Load' : cannot convert parameter 1 from 'char [10]' to 'class RE_IO::IO_FILE *'
When using the stringtable class exactly as presented in the tutorials, I get the same error. I tried first loading the file with an IO_FILE.Open but then it tells me that it cannot convert from RE_IO::IO_FILE to RE_IO::IO_FILE *.
Fairly new to C++... and beyond baffled.
const char *Str;
STRINGTABLE Stringtable;
Stringtable.Load("mitch.txt");
Str = Stringtable.GetString(3);
Specifically, when trying to specify an external file as my source for the method 'Load', I get the following charming error:
error C2664: 'Load' : cannot convert parameter 1 from 'char [10]' to 'class RE_IO::IO_FILE *'
When using the stringtable class exactly as presented in the tutorials, I get the same error. I tried first loading the file with an IO_FILE.Open but then it tells me that it cannot convert from RE_IO::IO_FILE to RE_IO::IO_FILE *.
Fairly new to C++... and beyond baffled.
Kenney Wong
bool Load (RE_IO::IO_FILE *file);
So you have to give it a valid pointer to a IO_FILE object. e.g.:
RE_IO::IO_FILE *fp = new RE_IO::IO_FILE;
if (fp)
fp->Open("mitch.txt", READ));
Stringtable.Load(fp);