All pastes #769558 Raw Edit

Mine

public c v1 · immutable
·published 2007-11-11 15:00 UTC
rendered paste body
#define __STEP__ 512char* getInput(){  int length = 0;  int input = 0;  char *text = malloc(__STEP__+2);  while(!text && (input = getchar()) != EOF)  {    ++length;    if ( (__STEP__-1)==(length%__STEP__))      realloc(text, (length+1)/__STEP__+__STEP__+ 2);    text[length] = input;  }  if(!text)  {    text[length] = '\0';  }  return text;}