@[TOC]c 文件操作1将数据二进制写入文件中
#include<stdio.h>
int main()
{
int arr[] = {1,2,3,4,5};
FILE *p_file = fopen("a.bin","wb");
if(p_file) {
fwrite(arr, sizeof(int),5,p_file);
fclose(p_file);
p_file = NULL;
}
return 0;
}
@[TOC]c 文件操作1将数据二进制写入文件中
#include<stdio.h>
int main()
{
int arr[] = {1,2,3,4,5};
FILE *p_file = fopen("a.bin","wb");
if(p_file) {
fwrite(arr, sizeof(int),5,p_file);
fclose(p_file);
p_file = NULL;
}
return 0;
}