well the reason i switched to Tc was that my Pelles C compiler went wrong ... it couldnt compile anything ...it kept saying "empty declaration" ...so i was tried of this damn message and though to give it a try under TC and lets see of my compiler (here Pelles C )is not working probably and lets assume my codes should at least be compiled !>
so , i just used that damn ancient compiler and ... everything crashed !!!
...
from this time and then .i will only use Pelles C compiler .. thats it ...
by the way the code i ran is :
(as you see there are bunch of codes that i disabled them (step by step ..i used diffrent procedures) ... and some how this piece of codes is what i got ...)
Code:#include <stdio.h> #include <process.h> #include <string.h> //#include <windows.h> #include <dos.h> /*struct Flopy_Drive_Sectors { char jumpCode[3];//0 - 2 Assembly Instruction for jump code. char oemName[8];//3 - 10 OEM Name. char bytes_Sector[2];//*11 - 12 Bytes per sector. char sec_Cluster;//13 Sector per cluster. char size_Sector_Reserved[2];//14 - 15 Number of reserved sector(Boot Sector) char fatCount;//16 Number of File Allocation Table char Max_Root_Entry[2];//17 - 18 Maximum entries possible under root directory. char Total_Sector_FS[2];//19 - 20 Total number of sectors in file system. char Media_Type;//21 Media Type(According to Microsoft 0xf8 for fixed disk and 0xf0 for removable disk. char sectors_per_fat[2];//22 - 23 Sectors allocated for each File allocation table. char sectors_per_track[2];//24 - 25 Sectors per track. char total_Head_Count[2];//26 - 27 Number of head in storage device. char no_Sectors_Before_Part[4];//28 - 31 Number of sectors before start of partition(Not applicable for floppy). char no_Sector_FS32[4];//32 - 35 Number of sectors in file system(32-bit value, not applicable for floppy). char BIOS_13h_Drive_No;//36 BIOS INT13h drive number. char reserved;//37 Not Used. char ext_Boot_Part_Signature;//38 Extended boot signature. char vol_Serial_Number[4];//39 - 42 Volume Serial Number. char vol_Lebel_Name[11];//43 - 53 Volume label in ASCII. char FS_Type[8];//54 - 61 File System Type. char boot_Code[448];//62 - 509 Boot Code, otherwise contains information to replace disk. char signature[2];//510 - 511 Signature for File System. } fds; FILE *fptr;*/ int main(void) { int j,i,k,start,sector; char buf[512],ch; clrscr(); gotoxy(27,5); printf("In the name of God\n"); gotoxy(22,7); printf("A S.Hossein hasan pour Project\n\n"); printf (" This program will show you the information stored on sector 0 of your hard Drive.\n if you are ready press any key to continue "); for (k=0;k<=4;k++){ //delay(50); printf("."); } getch(); sector =0; if (absread (0, 1, sector, &buf)!=0) { printf ("Error"); exit(1); } printf("Read Successful!\n"); // fptr=fopen("D:\temp.fds","w"); for (i=0;i<=12;i++) { for(j=0;j<=2;j++) printf("Assembly Jump COde is: %02x\n",&buf[j]); for(j=3;j<=10;j++) printf("OEM IS: %s\n",&buf[j]); for(j=11;j<=12;j++){ printf("Bytes per sector: %0\n",&buf[j]);} for(j=13;j<14;j++){ printf("sector per cluster is: %d\n",&buf[j]);} } // PrintFlopyInformation(Bpb_bpb); getch(); return 0; }



LinkBack URL
About LinkBacks



