把写内容过程比较好的一些内容片段做个珍藏,下面内容是关于C语言变成:磁盘检测片段的内容。#include stdio.h#include dos.h#include malloc.hvoid main(void){struct fatinfo fat;long sector, total_secto...
把写内容过程比较好的一些内容片段做个珍藏,下面内容是关于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);
}
本文标题为:C语言变成:磁盘检测源码片段
基础教程推荐
- VisualStudio2010安装教程 2023-01-05
- C语言数组长度的计算方法实例总结(sizeof与strlen) 2023-04-26
- C语言的三种条件判断语句你都了解吗 2023-03-05
- Qt数据库应用之实现通用数据库请求 2023-03-18
- character-encoding – Linux中最常见的C语言编码(和Unix?) 2023-11-21
- 纯C++代码详解二叉树相关操作 2023-05-15
- C语言植物大战数据结构二叉树递归 2023-04-09
- 利用QT设计秒表功能 2023-05-30
- 05-C语言进阶——动态内存管理 2023-11-20
- g++: const 丢弃限定符 2022-10-07
