首页 > 代码库 > file os

file os

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);

}

 

file os