Results 1 to 1 of 1

Thread: Plz help mera ye C ka program aik Error de raha hai chal nahi raha

  1. #1
    iori240 is offline Senior Member+
    Last Online
    7th February 2023 @ 08:50 AM
    Join Date
    28 Aug 2007
    Posts
    38
    Threads
    9
    Credits
    1,287
    Thanked
    3

    Default Plz help mera ye C ka program aik Error de raha hai chal nahi raha

    #include <graphics.h>
    #include <stdio.h>
    #include <dos.h>
    #include <stdlib.h>
    #include <conio.h>

    union REGS inregs, outregs ;
    /* int argn, char **argv */
    /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15*/
    int col[]={0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64} ;
    int pats[]={1,2,4,8,16,32,40};
    FILE *fpin;
    void read_n_disp(void),
    open_file(char *filename),
    get_filename (char *s);
    void grey_level(void);
    void putdot (int , int , int);
    void main (void)
    {
    int i, j, graphmode, graphdriver, EGAVGA_driver;
    float l,k;
    char c, filename[10], ch;
    get_filename (filename);
    open_file(filename),
    grey_level();
    read_n_disp();
    //closegraph ();
    textbackground (BLACK) ;
    textcolor (BLINK) ;
    printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\Hit Enter Key for edit mode:");
    getch();
    /******* end of main *******/ }
    /***
    read_n_disp()
    Reads the data file one character at a time. ****/
    void read_n_disp (void)
    {
    int col, i, c, c1, c2, c3, x, y, s;
    x=50; y=1; s=1;
    while ((c=fgetc(fpin))!=EOF)
    {
    check_code:
    c1=fgetc(fpin); c2=fgetc(fpin); c3=fgetc(fpin);
    /*if((c1==48 && c2==63 && c3==48)|| (c1==63 && c2==48 && c3==63)) {*/
    /*if((c1==64 && c2==79 && c3==64)|| (c1==79 && c2==46 && c3==79)) {*/
    if((c1==65 && c2==79 && c3==65)|| (c1==79 && c2==65 && c3==79)) {
    /* for ((i=0; i<26; i++) {c=fgetc(fpin);}*/
    }
    else {
    goto check_code;
    }
    for (i=0; i<1024; i++) { c=fgetc(fpin);}
    while ((c=fgetc(fpin))!=EOF)
    {
    c= c & 0x3f ;
    c= 63 - c ;
    pxon: if (s==1) {s++;} else {c=c-0; s=1;}
    putdot (x,y,c) ;
    if (x<=(50+208)) {x++;} else { for (i=0;
    i<1024; i++)
    { c=fgetc(fpin);}
    x=50; y++;}
    }
    }
    /* printf("%d"' y-1);*/
    fclose(fpin);
    }
    /****** open_file()
    Attempts to open a data file for reading. *********/
    void open_file(char *filename)
    {
    if((fpin = fopen(filename, "r")) == NULL){
    printf("\nCannot open %s. Abort\n", filename);
    exit(EXIT_FAILURE);
    }
    }
    /***** get_filename()
    * Gets the name of the data file to be read. *******/
    void get_filename(char *s)
    {
    printf("\n\n\n\n\n\n\n\n\n\n\n\n\nEnter file name:");
    gets(s);
    }
    /* ************************************************** ********** */
    /* 64 Grey Shades Display Program */
    void grey_level ()
    {
    /* union REGS inregs, outregs;*/
    int i, j;
    /* switch video mode to 320x200 256 colors */
    inregs.h.al = 19;
    inregs.h.ah = 0;
    int86 (16, &inregs, &outregs) ;
    /* generate 256 colors out of 262,144 possible combinations colors */
    for ( i = 0; i < 64; i++)
    { /* R G B */
    inregs.x.ax = 0x1010 ;
    inregs.x.bx = i ;
    inregs.h.cl=i;
    inregs.h.ch=i ;
    inregs.h.dh=i ;
    int86 (16, &inregs, &outregs) ;
    }
    }
    /*make_blk()
    {
    int i, k, j, m, n;
    k=0;
    for (i = 0; i < 128; i++)
    {
    for (k = 0; k < 128; k++)
    {
    putdot (i, k+50, (i&63)) ;
    }
    }
    printf("\nhit Enter Key to go back to edit mode: ");
    getche();
    }
    */
    void putdot (int x, int y, int c)
    {
    inregs.h.al = c; /* color number */
    inregs.x.cx = x; /* x-coordinate */
    inregs.x.dx = y; /* y-coordinate */
    int86 (16, &inregs, &outregs) ;
    }


    output per file mangta hai mene .dat k naam se file bana kar BIN k folder men rakh di phir file name diya to black screen dekha raha hai jab k black & white ana chahiye output plz help or wo file 1010101 binary form men hai
    Attached Files Attached Files

Similar Threads

  1. Replies: 1
    Last Post: 5th December 2011, 10:23 PM
  2. Replies: 15
    Last Post: 24th June 2010, 12:33 PM
  3. Mera antivirus kiyon nahi chal raha :(
    By Ryden in forum Ask an Expert
    Replies: 8
    Last Post: 10th November 2009, 03:59 PM
  4. hotmail per mera account nahi ban raha hain please help me
    By faridak185 in forum Ask an Expert
    Replies: 6
    Last Post: 22nd April 2009, 06:06 PM
  5. GoogleEarth Nahi chal raha
    By saqi63 in forum Ask an Expert
    Replies: 8
    Last Post: 7th March 2007, 07:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •