Its pretty darn absic... I updated the loading of dimensions with get(), and used atoi to make it int. works much better and now only problem is it doesnt load what I want it too(the values come out 0x0, instead of 10x10, doesnt close instant now though)
Set-Size function:
Code:
void testclass::setsize() {
char *char_length=new char[3];
char *char_width=new char[3];
std::ifstream s_size(dat_filename);
s_size.get(char_length, 2, ' ');
s_size.get(char_width, 2, ' ');
s_size.close();
dat_length=atoi(char_length);
dat_width=atoi(char_width);
}//testclass setsize func
The file:
Code:
10 10
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
The file is pretty basic, just a test right now. Its just that it doesnt load the first two properly.