主页->库函数目录->对话框输入函数->getCoords

功能:
显示对话框,让用户输入几组坐标。用户一次输入一组坐标,即两个坐标值,坐标值之间用逗号分隔,例如: 10,25

声明:
int* getCoords(int coords[], unsigned int pairs, LPCSTR title = "Input Coordinations");

参数:
coords[]: 存储用户输入的坐标:coords[0]:x1, coords[1]:y1; coords[2]:x2, coords[3]:y2;......
pairs: 想要输入的坐标对的数量。该函数可以按照调用者制定的数量不断要求用户输入坐标对
title: 对话框的标题。

返回值:
返回指向coords数组的指针。

示例:

#include "graphics.h"
int main() {
  initgraph(640, 480);

  int coords[4];
  getCoords(coords, sizeof(coords)/sizeof(int)/2, "请输入坐标");
  line(coords[0], coords[1], coords[2], coords[3]);

  ege::getch
();
  return 0;
}