polyline(const POINT*,int num)中的第一个参数怎么使用?

0

应该把点的坐标放在一个数组里吗?easy help里的说明聊胜于无。最好直接举栗子,感谢!

1

例如:

#include <graphics.h>
#include <conio.h>
#include <time.h>

int main()
{
	initgraph(800, 600);
	srand((int)time(0));

	POINT p[10];
	for (int i = 0; i < 10; i++)
	{
		p[i].x = rand() % 800;
		p[i].y = rand() % 600;
	}
	polyline(p, 10);
	_getch();
	closegraph();
	return 0;
}
ava
xiongfj ◑◑

2020-3-15

技术讨论社区