不知道为什么不出东西。。
struct img
{
int x;
int y;
IMAGE imggrass;
struct img next;
};
main()
{
struct img *p;
p=(struct img)malloc(sizeof(struct img));
initgraph(640,480);
loadimage(&p->imggrass, "res\bmp_grass.bmp");
p->x=50;
p->y=50;
putimage(p->x,p->y,&p->imggrass);
getch();
closegraph();
}
IMAGE imggrass;
修改为
IMAGE * imggrass;
loadimage(&p->imggrass, "res\bmp_grass.bmp");
换上完整路径看看