circle program :;

Discussion in 'C' started by anny**, Oct 16, 2008.

  1. anny**

    anny** New Member

    Joined:
    Oct 4, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    hi to all
    it is a circle program not running , giving erorrs on my c language but it is working on my friend computer (c language) here is code ;

    PHP:
    #include<stdio.h>
    #include<conio.h>
    #include<graphics.h>
    #include<dos.h>
    int  main ()
    {
    int driver,modei;
    detectgraph(&driver,&mode);
    initgraph(&driver,&mode,"...\\ bgi");
    setcolor(8);
    for(
    i=10;i<201;i++)
    {
    sound(i);
    circle(300,200,i);
    delay(1000);
    nosound();
    }
    getch();
    }
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    What errors?
     
  3. oogabooga

    oogabooga New Member

    Joined:
    Jan 9, 2008
    Messages:
    115
    Likes Received:
    11
    Trophy Points:
    0
    Also, is your friend using the same operating system and compiler as you?
    graphics.h is an old (Borland BGI) thing. You're best not to use it.
     
  4. anny**

    anny** New Member

    Joined:
    Oct 4, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    i tried on both dev-C++ 4.9.9.2 and tc v2.01 in tc it does not give any error, it is compling but not running
    but in dev it shows following errors

    F:\anny\F graphics.h: No such file or directory.

    F:\anny\Untitled6.cpp In function `int main()':

    8 F:\anny\Untitled6.cpp `detectgraph' undeclared (first use this function)
    (Each undeclared identifier is reported only once for each function it appears in.)

    9:25 F:\anny\Untitled6.cpp [Warning] unknown escape sequence '\i'

    9 F:\anny\Untitled6.cpp `initgraph' undeclared (first use this function)

    10 F:\anny\Untitled6.cpp `setcolor' undeclared (first use this function)

    13 F:\anny\Untitled6.cpp `sound' undeclared (first use this function)

    14 F:\anny\Untitled6.cpp `circle' undeclared (first use this function)

    15 F:\anny\Untitled6.cpp `delay' undeclared (first use this function)

    16 F:\anny\Untitled6.cpp `nosound' undeclared (first use this function)
     
  5. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    You need to find out what is installed on your friend's computer that includes the graphics.h file.
    Probably a dir/s will do the trick, from the root on each drive. That should give you a clue where it comes from, e.g. if it's in (made-up path) c:\program files\borland\turbo_c\include\graphics.h then that fairly obviously points to Borland Turbo C.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice