把写内容过程比较好的一些内容片段做个珍藏,下面内容是关于C语言变成:磁盘检测片段的内容。
#include <stdio.h>
#include <dos.h>
#include <malloc.h>
void main(void)
{
struct fatinfo fat;
long sector, total_sectors;
getfat(3, &fat);
if ((buffer = malloc(fat.fi_bysec)) == NULL)
printf("Error allocating sector buffern");
else
for (sector = 0; sector < total_sectors; sector++)
if (absread(2, 1, sector, buffer) == -1)
{
printf("n007Error reading sector %ld press Entern",
sector);
getchar();
}
else
printf("Reading sector %ldr", sector);
}
原文地址:http://blog.51cto.com/14122754/2339303
时间: 2024-10-13 07:34:35