PDA

View Full Version : سوال: رفع ارور



shahinshyd
شنبه 15 خرداد 1389, 17:04 عصر
باعرض سلام من یک برنامه ایجاد چند تا شکل با قابلیت رنگ کردن اونا رو نوشتم ولی این ارور هاش منو بیچاره کردن اگه میشه کمکم کنید

#include<graphics.h>
#include<conio.h>
#include<iostream.h>
void cirrcle(int);
void linne(int)
void recct(int);
void oppen();
void dellet();
int main()
{
char ch;
int x1,y1,x2,y2,d;
ifstream fin("save.txt");
ofstream fout("save.txt");
int dg=DETECT,gm=0;
initgraph(&gd,&gm,"");
cout<<"press the bottons bellow and the information require"<<endl<<"q:quit, c:circle, r:rectange, l:line, s:save, d:delet,o:open";

do
{


cin>>ch;
switch(ch)
{
case 'r': recct(0); break;
case 'c': cirrcle(0); break;
.
.
.
case 'l': linne(0); break;
case 'o': oppen(); break;
case 'd': dellet(); break;
}
}while(ch!='q');
getch();
closegraph();
return 0;
}


void recct(int a)
{
(a)?fin>>x1>>y1>>x2>>y2>>col; :cin>>x1>>y1>>x2>>y2>>col;
fout<<'r'<<' '<<x1<<' '<<y1<<' '<<x2<<' '<<y2<<endl;
setcolor(col);
rectangle(x1,y1,x2,y2);
}

void cirrcle(int a)
{
(a)?fin>>x1>>y1>>d>>col;:cin>>x1>>y1>>d>>col;
fout<<'c'<<' '<<x1<<' '<<' '<<y1<<' '<<d<<endl;
setcolor(col);
circle(x1,y1,d);
}

void linne(int a)
{
(a)?fin>>x1>>y1>>x2>>y2>>col;:cin>>x1>>y1>>x2>>y2>>col;
fout<<'l'<<' '<<x1<<' '<<y1<<' '<<x2<<' '<<y2<<endl;
setcolor(col);
line(x1,y1,x2,y2);
}

void oppen()
{

while(!eof())
{
fin>>ch;
switch(ch)
{
case 'r': recct(1); break;
case 'c': cirrcle(1); break;
.
.
.
case 'l': linne(1); break;
case 'o': oppen(1); break;
case 'd': dellet(1); break;
}
}
}

shahinshyd
دوشنبه 24 خرداد 1389, 17:42 عصر
اقا کسی نیست جواب مارو بده

r00tkit
دوشنبه 24 خرداد 1389, 17:49 عصر
سلام
توی چه محیطی دارید این ها رو کامپایل می کنید ؟

احتمالا از graphics.h اشکال می گیره



graphics.h is a very old library for doing graphics in DOS with Borland C++ 3.x.
It's not supported under Windows, and the compiler isn't supported either.