Page 1 of 2 12 LastLast
Results 1 to 12 of 21

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

    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};
    void read_n_disp(void),
    open_file(char *filename),
    get_filename (char *s);
    FILE *fpin;
    /*void grey_level(void);*/
    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 fet_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 */
    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();
    }
    */
    int 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) ;
    }

  2. #2
    M Imran Mugal's Avatar
    M Imran Mugal is offline Senior Member+
    Last Online
    17th March 2015 @ 04:54 PM
    Join Date
    17 Dec 2010
    Location
    Mehrabpur Sindh
    Age
    37
    Gender
    Male
    Posts
    976
    Threads
    14
    Credits
    960
    Thanked
    49

    Default

    Dear error kiya deraha hai????

  3. #3
    M Imran Mugal's Avatar
    M Imran Mugal is offline Senior Member+
    Last Online
    17th March 2015 @ 04:54 PM
    Join Date
    17 Dec 2010
    Location
    Mehrabpur Sindh
    Age
    37
    Gender
    Male
    Posts
    976
    Threads
    14
    Credits
    960
    Thanked
    49

    Default

    error?

  4. #4
    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 error

    linker error de raha hai
    linker-error-undefined-symbol-_closegraph-module-graphex-cpp

  5. #5
    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

    function should return a valur ki bhi warninig aa rahi hai

  6. #6
    sayhellotoit's Avatar
    sayhellotoit is offline Senior Member
    Last Online
    23rd September 2017 @ 07:51 PM
    Join Date
    01 May 2009
    Posts
    1,003
    Threads
    5
    Credits
    53
    Thanked
    127

    Default

    Kis compiler mein compile ker rahay hain? Meray khayal say TurbC ya BorlandC ho ga.

    1)Function should return value:
    Sab say akhri function int putdot (int x, int y, int c) ki return type int hay, per iss mein return kuch nahi kia ja raha. Ager tu return kuch nahi kerna tu type void honi chahiyay: void putdot (int x, int y, int c)

    2) FILE *fpin;
    Variable declaration shuru mein honi chahiyay.

    3)get_filename ki jaga typing mistake fet_filename

    Bas yeh theek ker lain, baqi sahi compile ho raha hay. Yeh teenu cheezain iss code mein sahi ker di gayee hain:

    #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) ;
    }

  7. #7
    Muhammaduf's Avatar
    Muhammaduf is offline Senior Member
    Last Online
    24th September 2017 @ 05:11 AM
    Join Date
    29 Jun 2012
    Location
    Toba Tek Singh
    Age
    29
    Gender
    Male
    Posts
    12,314
    Threads
    517
    Credits
    11
    Thanked
    1180

    Default

    Ap Tamam Chakar Choren New Window Kar Len Esey Errors Program Files Corrupt Honey Ki Waja Se Atey Hen.
    [B][CENTER][SIZE=4][URL="https://www.youtube.com/watch?v=1LLCI_DmRj0"]AdSense Vs. Affiliate Marketing — $100 on 1,000 Views?![/URL][COLOR="#FF0000"]?![/COLOR][/SIZE][/CENTER][/B]

  8. #8
    HASEEB610's Avatar
    HASEEB610 is offline Senior Member+
    Last Online
    16th September 2015 @ 12:07 AM
    Join Date
    16 Dec 2011
    Location
    KARACHI
    Gender
    Male
    Posts
    617
    Threads
    42
    Credits
    803
    Thanked
    35

    Default

    Quote Muhammaduf said: View Post
    Ap Tamam Chakar Choren New Window Kar Len Esey Errors Program Files Corrupt Honey Ki Waja Se Atey Hen.
    Bhayya g dehan se bhai me C language pe kaafi time se kam kar raha hun linker error aata hai to usko set karne k liye aap options me jayen linker me jayen phr libraries me jayen phr graphics library me click karen X ka nishaan aa jayega to matlab library select ho gayi hai linker error ese set hota hai baaki errors bhaiyon ne shayad bata diye hen
    [IMG]http://i1302.***********.com/albums/ag135/Haseeb_Ur_Rehman/cooltext9167469701_zpsb72aca51.gif[/IMG]

  9. #9
    M Imran Mugal's Avatar
    M Imran Mugal is offline Senior Member+
    Last Online
    17th March 2015 @ 04:54 PM
    Join Date
    17 Dec 2010
    Location
    Mehrabpur Sindh
    Age
    37
    Gender
    Male
    Posts
    976
    Threads
    14
    Credits
    960
    Thanked
    49

    Default

    Dear me ne C pr kam to ni kiya albta padhty wqt kuch program bnay zror thy un k balbuty pr kehraha hn Shaid ap ne ye graph ko link ni diya turbo C me to aisy diya jata hai....
    "initgraph(graphmode=0,graphmode=0,"c:\\tc\\bin\\b gi");
    Mazeed Expert bro bethy hn wo btain gy jis se me b ap b sub he ko moka mly ga sekhny ka.. INSHALLAH

  10. #10
    Muhammaduf's Avatar
    Muhammaduf is offline Senior Member
    Last Online
    24th September 2017 @ 05:11 AM
    Join Date
    29 Jun 2012
    Location
    Toba Tek Singh
    Age
    29
    Gender
    Male
    Posts
    12,314
    Threads
    517
    Credits
    11
    Thanked
    1180

    Default

    Quote haseeb610 said: View Post


    bhayya g dehan se bhai me c language pe kaafi time se kam kar raha hun linker error aata hai to usko set karne k liye aap options me jayen linker me jayen phr libraries me jayen phr graphics library me click karen x ka nishaan aa jayega to matlab library select ho gayi hai linker error ese set hota hai baaki errors bhaiyon ne shayad bata diye hen
    شکریہ بھائی جان میں نے آپ کی ریپلائے پر دھیان نہیں دیا تھا۔

  11. #11
    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

    Bhai ap ka bohat shukriya ap ne problen solve ki Allah apko har khushi de or ap ko mazeed taraqi de thanx bhai

  12. #12
    M Imran Mugal's Avatar
    M Imran Mugal is offline Senior Member+
    Last Online
    17th March 2015 @ 04:54 PM
    Join Date
    17 Dec 2010
    Location
    Mehrabpur Sindh
    Age
    37
    Gender
    Male
    Posts
    976
    Threads
    14
    Credits
    960
    Thanked
    49

    Default

    Dear hua kuch ???????

Page 1 of 2 12 LastLast

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
  •