我来我网
https://5come5.cn
 
您尚未 登录  注册 | 菠菜 | 软件站 | 音乐站 | 邮箱1 | 邮箱2 | 风格选择 | 更多 » 
 

本页主题: 绝对磁盘扇区读、写数据 显示签名 | 打印 | 加为IE收藏 | 收藏主题 | 上一主题 | 下一主题

klo



性别: 帅哥 状态: 该用户目前不在线
等级: 品行端正
家族: YD一族
发贴: 473
威望: 0
浮云: 1105
在线等级:
注册时间: 2007-01-10
最后登陆: 2008-06-30

5come5帮你背单词 [ united states /ju:'naitid'steits/ n. 美国,(缩)u.s. ]


绝对磁盘扇区读、写数据

函数名: absread, abswirte
功  能: 绝对磁盘扇区读、写数据
用  法: int absread(int drive, int nsects, int sectno, void *buffer);
int abswrite(int drive, int nsects, in tsectno, void *buffer);
程序例:
/* absread example */

#include <stdio.h>
#include <conio.h>
#include <process.h>
#include <dos.h>

int main(void)
{
  int i, strt, ch_out, sector;
  char buf[512];

  printf("Insert a diskette into drive A and press any key\n");
  getch();
  sector = 0;
  if (absread(0, 1, sector, &buf) != 0)
  {
    perror("Disk problem");
    exit(1);
  }
  printf("Read OK\n");
  strt = 3;
  for (i=0; i<80; i++)
  {
    ch_out = buf[strt+i];
    putchar(ch_out);
  }
  printf("\n");
  return(0);
}
 
 
顶端 Posted: 2008-01-06 21:06 | [楼 主]
我来我网·5come5 Forum » 程序员之家

Total 0.008747(s) query 4, Time now is:05-03 17:45, Gzip enabled
Powered by PHPWind v5.3, Localized by 5come5 Tech Team, 黔ICP备16009856号