#2
djchao2022-07-25 10:37
|
有一个数据文件infile100个数据,前4个是char型,后96个是double型,
我做了如下程序,前4个会读,后96个不会读,问题是这种场合下,如何把char型转化double型?
ifstream fi;
fi.open(infile,ios::binary|ios::in);
if (!fi){
ShowMessage("cannot open this file");
return;
}
char *buffer = new char[length];
fi.read (buffer,length);
int a = buffer[0];
int b = buffer[1];
int c = buffer[2];
int d = buffer[3];
???