void input(char *buffer){ int chunk=256,point=0; int main = 1024; char buff; while(buff = getchar()){ if(point == main){ buffer = (char *)realloc(buffer,main+chunk); main += chunk; } if(buff == '\n'){ buffer[point] = 0; break; }else{ buffer[point++] = buff; } } }
Обсуждают сегодня