tahmtan
چهارشنبه 03 آبان 1391, 20:16 عصر
سلام دوستان
من با برنامه نویسی با زبان ++C تا حدودی آشنایی دارم
حالا بر حسب نیاز باید کار کردن و ساختن اشکال گرافیکی با C و ++C رو تجربه کنم
تو محیط Turbo C++ قطعه کد زیر رو که از همین سایت خودمون کپی کردم رو نوشتم ولی ای پیغام رو بم میده برای رفع و اجرای برنامم باید چی کار کنم؟
قزعه کد:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int xmax, ymax;
initgraph(&gdriver, &gmode, "F:\\Pro\\TC\\BGI");//***masire TC rooye computere shoma***, kheily mohem
setbkcolor(1);//range pas zamineh
setcolor(10); //range matn
xmax = getmaxx();
ymax = getmaxy();
line(0, 0, xmax, ymax); // tabee keshidane khat
setcolor(4);
rectangle(100,100,550,400);//tabee keshidane mostatil
setfillstyle(1,2); //olgooye por kardan
floodfill(101,101,4); //por kardane mostatil
setcolor(14);
settextstyle(8,0,5); //fonte matn
outtextxy(250,200,"Hello!"); //chape matn
getch();
closegraph();
return 0;
}
خطا:
Compiling NONAME00.CPP:
Fatal ..\INCLUDE\GRAPHICS.H 19: Error directive: BGI graphics not supported under Windows
من با برنامه نویسی با زبان ++C تا حدودی آشنایی دارم
حالا بر حسب نیاز باید کار کردن و ساختن اشکال گرافیکی با C و ++C رو تجربه کنم
تو محیط Turbo C++ قطعه کد زیر رو که از همین سایت خودمون کپی کردم رو نوشتم ولی ای پیغام رو بم میده برای رفع و اجرای برنامم باید چی کار کنم؟
قزعه کد:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int xmax, ymax;
initgraph(&gdriver, &gmode, "F:\\Pro\\TC\\BGI");//***masire TC rooye computere shoma***, kheily mohem
setbkcolor(1);//range pas zamineh
setcolor(10); //range matn
xmax = getmaxx();
ymax = getmaxy();
line(0, 0, xmax, ymax); // tabee keshidane khat
setcolor(4);
rectangle(100,100,550,400);//tabee keshidane mostatil
setfillstyle(1,2); //olgooye por kardan
floodfill(101,101,4); //por kardane mostatil
setcolor(14);
settextstyle(8,0,5); //fonte matn
outtextxy(250,200,"Hello!"); //chape matn
getch();
closegraph();
return 0;
}
خطا:
Compiling NONAME00.CPP:
Fatal ..\INCLUDE\GRAPHICS.H 19: Error directive: BGI graphics not supported under Windows