   loading a simple bmp
  hi every one , i have written a bmp file loader but i have problem with it, my compiler is turbo c++ and my code is this: #include <stdio.h>#include <conio.h>#include <dos.h>  unsigned char buf[14][80];void goto_xy(int x,int y);void load_pic();int main(){ load_pic(); getch(); return 0;}void load_pic(){  char fname[80];  FILE *fp;  register int i,j;  char far  *ptr= (char far *)0xB8000000;  char far  *temp;  temp=ptr;  for(i=0;i<14;i++)  for(j=0;j<80;j+=2){buf[j]=*temp;buf[j+1]=*(temp+8152);*temp=0;*(temp+8152)=0;temp++;}  goto_xy(0,0);  printf("enter file name: ");  gets(fname);  fp=fopen(fname,"rb");  if(fp==NULL){printf("cannot open the file,press a key...");temp=ptr;   for(i=0;i<14;i++)for(j=0;j<80;j+=2){  *temp=buf[j]; *(temp+8152)=buf[j+1];  temp++; }   return ; }   for(i=0;i<8152;i++){  *ptr=getc(fp);   *(ptr+8152)=getc(fp);   ptr++;  }   fclose(fp);   }  void goto_xy(int x,int y){union REGS r;  r.h.ah=2;r.h.dl=y;r.h.dh=x;  r.h.bh=0;int86(0x10,&r,&r);}the problem is with buf[j] for displaying , it is "general protection exception, 0x215F:0x01BB Processor Fault" can anyone help me?
  *shudder*It looks like you're in real mode. Text mode memory isn't at 0xB8000000 (unless a far cast actually composes the segment:offset). Text mode memory is in segment 0xB800 but since segments overlap every 16 bytes the linear offset is actually 0xB8000.However if you're running this under Windows there's a chance that this is actually a privileged operation.Jans.   ;  As Jansic said, unless you're running some flavour of DOS, I would be very surprised if this worked.Here in the 21st century we use graphics APIs to draw to the screen [smile]   