Original Post
This is my code that reads(anyway it should read) a binary file, but it keeps giving this error and i don''t know why.
FILE *setupFile; // Used For Filling out window
BYTE screenResolution; // Used To Set Screen Resolution
BYTE bitsPerPixel; // Used To Set Color Depth
BYTE soundSettings; // Used To Set Music & Sound
BYTE OpenGL_DirectX; // Used To Set RederingDevice
BYTE graphicsDetail; // Used To Set Texture Quality
BYTE fileData[5]; // Array To Read Setupfile Data
int checkFile; // Used To Check I/O
//***Open file and read the data
setupFile = fopen("c:/curtis/programeerstuff/curtisc++/setup/setup.bin", "r");
if(setupFile==NULL)
{
return -1;
}
else
{
if((checkFile = _read(setupFile,fileData,5)) <= 0)
{
return -1;
}
else
{
screenResolution = fileData[0];
bitsPerPixel = fileData[1];
soundSettings = fileData[2];
graphicsDetail = fileData[3];
OpenGL_DirectX = fileData[4];
}
}
fclose(setupFile);
the error is this one:
error C2664: ''_read'' : cannot convert parameter 1 from ''struct _iobuf *'' to ''int''
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
does someone know what i do wrong?
Thanx in advance