void writeFile()
{
const unsigned int ONE = 1;
FILE* file = open("a.db", "wb)
if(NULL != file)
{
unsigned int apple = 6;
if(ONE = fwrite(&apple, sizeof(unsigned int), ONE, file))
{
success;
}
fclose(file);
}
}
void readFile()
{
FILE* file = fopen("a.db", "rb");
if(NULL != file)
{
unsigned int a = 0;
if(ONE == fread(&a, sizeof(unsigned int), ONE, file))
{
read success;
}
fclose(file);
}
时间: 2024-10-15 22:46:16