Learning C++

hello friends, Im new here, I just found the page and made me smile because I have many doubts...please help me , the source code is this :

/* procesa regiones */

#include
#include
#include



void main()
{ int d, m; char *p; unsigned tam; int i, op;
d=DETECT; initgraph(&d,&m,"bgi");
if (graphresult()) exit(1);
setbkcolor(BLACK); /*** fondo negro ***/

/*** llena pantalla con color gris suave ***/
/* setfillstyle(1,LIGHTGRAY);
floodfill(35,36,getcolor());
*/

/*** traza circulo con color rojo ***/
setcolor(BLUE);
setfillstyle(1,YELLOW);
for (i=0;i<5;i++)
{ circle(40+80*i,100,20);

/*** llena interior de circulo usando estilo de llenado pleno=1 ***/


floodfill(35+80*i,110,getcolor());
}
setfillstyle(1,RED);

setcolor(BLUE);
bar(20,20,60,50);
setcolor(RED);
rectangle(10,10,70,60);

/*** gestiona memoria para buffer ***/

tam=imagesize(10,10,70,60);
p=(char *) malloc(tam);

/*** copia region en p ***/
if (p==NULL) goto fin;
getimage(10,10,70,60,p);

/*** muestra operaciones ***/
for (i=0;i<5;i++)
{ putimage(30+80*i,100,p,i);
}
settextstyle(2,HORIZ_DIR,3);
setcolor(WHITE);
outtextxy(20,getmaxy()-50,"Presione enter para borrar rectangulo _");
do ; while(getch()=='
');

putimage(10,10,p,XOR_PUT);
getch();
fin: closegraph();

}
the problem I have is that this program compiles but doesnt execute
:(, why?? I dont know ....and one favor when I have to write this :"initgraph(&d,&m,"bgi")" why to put "bgi" ??? in which case???;

pd.Im from South America so please write me in order to understand, si??

Comments

  • have u checked ur OpenGL installation?
  • : have u checked ur OpenGL installation?
    :
    I already fixed it :D !!!!

    ty !!!

    the problem was : initgraph(&d,&m,[blue]"c:\BC5\BGI"[/blue]);
    it must be : initgraph(&d,&m,[blue]"c:\Borlandc\Bgi[/blue]"); now my program works :P
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories