本文介绍了帮助编写二进制文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 您好, 我一直在尝试这个并且无法解决它,有人可以指导我做一个例子或者告诉我我做错了什么。 //////// 我正在处理一些数据...获取Count的值。 long ArraySize = Count; BYTE * FileOut; FileOut = new BYTE [ArraySize]; /// 我可以将我的数据存入文件中。 /// 我在尝试将FileOut写入二进制文件时遇到问题。 FILE * file2 = NULL; if((file2 = fopen(FileName,ab))== NULL) { Temp.Format(_T(无法打开指定文件)); } else { fwrite(FileOut,sizeof(FileOut [0]),sizeof(FileOut)/ sizeof(FileOut [0]),file2); } delete [] FileOut; fclose(file2); 任何帮助将不胜感激。 对不起我没有得到完整的数组只有4个数字。解决方案 Hello,I have been trying this and have not been able to resolve it, can someone please direct me to an example or tell me what I am doing wrong.////////I am processing some data... getting a value to Count.long ArraySize = Count;BYTE *FileOut;FileOut = new BYTE[ArraySize];///I am able to put my data into file out.///I am having issues trying to write FileOut to a binary file.FILE *file2 = NULL;if ((file2 = fopen(FileName, "ab")) == NULL){Temp.Format(_T("Could not open specified file"));}else{fwrite(FileOut, sizeof(FileOut[0]), sizeof(FileOut)/ sizeof(FileOut[0]),file2);}delete[]FileOut;fclose(file2);Any help will be appreciated.Sorry I am not getting the full array out only 4 numbers. 解决方案 这篇关于帮助编写二进制文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-11 02:34