把写内容过程比较好的一些内容片段做个珍藏,下面内容是关于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语言变成:磁盘检测源码片段


基础教程推荐
- 使用C/C++读写.mat文件的方法详解 2023-03-05
- 漫画讲解C语言中最近公共祖先的三种类型 2023-01-01
- 使用VS2022开发在线远程编译部署的C++程序(图文详解) 2023-01-15
- C语言文件操作与相关函数介绍 2023-06-13
- C语言预编译#define(预处理) 2023-04-03
- C++高级数据结构之并查集 2023-04-20
- 如何告诉 MinGW 链接器不要导出所有符号? 2022-10-07
- C++类和对象到底是什么 2022-11-12
- C/C++ Qt StatusBar底部状态栏应用教程 2023-01-10
- C语言实现简易停车场管理系统 2023-03-13