TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: BJOERNAR JENSEN
date: 1997-11-28 21:10:00
subject: absread()

Hi...
I'm new to c++ and I'm trying to read the first sector on 'c drive' using 
absread. This because absread is supposed to read the sector(s) you tell it 
to read regardless FAT, directories and files..
Here it is:
#include 
#include 
void absread(int drive, int nsects, long lsect, void *buffer);
void main(void)
{
       char buf[16384];
       ofstream file;
       cout << "outfile : 1sector.bin " << endl;
       file.open("1sector.bin", ios::binary);
       absread(2,1,0, buf);
       file.write((char *) &buf, sizeof(buf));
       file.close;
}
Can ANYONE please tell me what's wrong ???? (I'm using BC4.5)
Bjoernar 'Beej' Jensen
--- BBBS/L v3.33 How
---------------
* Origin: Errors HQ: Prog/Emul/Linux/Demos, +47-56341083 (2:211/16)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.