模拟烟花的程序,运行总出错,请c语言大师指点!!!
来源:百度知道 编辑:UC知道 时间:2024/05/19 19:11:00
#include<stdio.h>
#include<stdlib.h>
#include<graphics.h>
#include<math.h>
struct star
{
double x;
double y;
double dx;
double dy;
double speed;
int color;
double r;
int IsMainStar;
struct star *next;
}*head=NULL;
int StarN=0;
InitGra()
{
int dr=DETECT,mode=0;
initgraph(&dr,&mode,"d:\\turboc2");
cleardevice();
}
void Push(struct star *new)
{
new->next=head;
head=new;
}
Delete(struct star *pre,struct star *now)
{
setcolor(0);
setfillstyle(1,0);
fillellipse((int )now->x,(int)now->y,now->r,now->r);
if(now == head )
head=now->next;
else
pre->next=now->next;
free(now);
StarN--;
}
void Clear()
{
struct star *now,*next;
#include<stdlib.h>
#include<graphics.h>
#include<math.h>
struct star
{
double x;
double y;
double dx;
double dy;
double speed;
int color;
double r;
int IsMainStar;
struct star *next;
}*head=NULL;
int StarN=0;
InitGra()
{
int dr=DETECT,mode=0;
initgraph(&dr,&mode,"d:\\turboc2");
cleardevice();
}
void Push(struct star *new)
{
new->next=head;
head=new;
}
Delete(struct star *pre,struct star *now)
{
setcolor(0);
setfillstyle(1,0);
fillellipse((int )now->x,(int)now->y,now->r,now->r);
if(now == head )
head=now->next;
else
pre->next=now->next;
free(now);
StarN--;
}
void Clear()
{
struct star *now,*next;
选项->目录->输出目录->不要设置和initgraph(&dr,&mode,"d:\\turboc2"); 一样就可以正常执行.
Options->Directories->Output Directory->不要设置和initgraph(&dr,&mode,"d:\\turboc2"); 一样就可以正常执行.
强!为什莫我的tc不能执行graphics的类似的图形输出程序。请相关高手指点。