All pastes #945268 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-16 20:29 UTC
rendered paste body
#include <stdio.h>

int main() {
  typedef int* my_type;
  my_type pipeids[1];

  int t;
  for (t =0; t < 1; t++) {
    int pipenum[2];
    pipenum[0] = t*2;//set to 0
    printf("pipenum0 = %d\n", pipenum[0]);
    pipenum[1] = t*2+1;//set to 1
    printf("pipenum1 = %d\n", pipenum[1]);

    if (pipe(pipenum) == -1) {
      perror("Failure of pipe");
    }

    pipeids[t] = pipenum;
    //should read pipeids[0] has pipenum[0] = 0 and pipenum[1] = 1
    printf("pipeids[%d] has pipenum[0] = %d and pipenum[1] = %d\n", t, (pipeids[t])[0], (pipeids[t])[1]);
  }
  return 1;
}