this might be a dumb suggestion but.... could you use a pointer to a large enough array?