I have very strange error and EclipseADT behaviour, when I use read and write function from . It's my code:
std::ifstream infile ("test.txt",std::ifstream::binary);
std::ofstream outfile ("new.txt",std::ofstream::binary);
// get size of file
infile.seekg (0,infile.end);
long size = infile.tellg();
infile.seekg (0);
// allocate memory for file content
char* buffer = new char[size];
// read content of infile
infile.read (buffer,size);
// write to outfile
outfile.write (buffer,size);
// release dynamically-allocated memory
delete[] buffer;
outfile.close();
infile.close();
When I try to build this code, I have error in Eclipse ADT: Invalid arguments 'Candidates are: stlpmtx_std::basic_istream> & read(char *, ?)'
However project build successful, and I have my .apk file. Eclipse shows this message: "Your project contains error(s), please fix them before running your application" I can't run my apk on device or emulator automatically. I tried to clear and delete/open my project, I tried to use this function in sample project, but I also had this error.
Tell me please, what I do wrong?
Engine version: cocos2d-x-2.2.0 OS: Windows 7 IDE: Eclipse ADT Build: v22.2.1-833290