#include <stdio.h> #include <dos.h> #include <stdlib.h> #include <bios.h> int main(void) { unsigned char buffer[512]; clrscr(); printf(<q>Insert disk in the A: drive, then press any key.\n</q>); /*wait for keypress*/ getch(); if(absread(0,1,1,&buffer) != 0) printf(<q>Cannot read the A drive.\n</q>); else printf(<q>Drive A , Sector 1 read\n</q>); return 0; }
Output: ====== Insert disk in the A: drive, then press any key. Drive A , Sector 1 read
|