I have priority queue which returns with pop function just int y, but I need return int x and int y. So I found, that I can use struct (struct point) to return two values from function, but I can't figure, how it implement (rewrite int out to struct and use it in main).
Structs:
typedef struct { int x; int y; int pri; } q_elem_t;
typedef struct { q_elem_t *buf; int n, alloc; } pri_queue_t, *pri_queue;
struct point{int PointX; int PointY;}; 
Pop function:
int priq_pop(pri_queue q, int *pri)
{
  int out;
  if (q->n == 1) return 0;
  q_elem_t *b = q->buf;
  out = b[1].y;
  if (pri) *pri = b[1].pri;
  /* pull last item to top, then down heap. */
  --q->n;
  int n = 1, m;
  while ((m = n * 2) < q->n) {
    if (m + 1 < q->n && b[m].pri > b[m + 1].pri) m++;
    if (b[q->n].pri <= b[m].pri) break;
    b[n] = b[m];
    n = m;
  }
  b[n] = b[q->n];
  if (q->n < q->alloc / 2 && q->n >= 16)
    q->buf = realloc(q->buf, (q->alloc /= 2) * sizeof(b[0]));
  return out;
}
Use in main():
  /* pop them and print one by one */
  int c; 
  while ((c = priq_pop(q, &p)))
  printf("%d: %d\n", p, c);
I'm starting with C, so I will be gratefull for any help.
 
     
     
     
    