I have a project in which I'm working on, that's gonna take an input that comes out from another program ran on the terminal, like so:
./other_program | ./project
so I'm taking the output from other_program and using it on project with
read(0, buffer, BUFF_SIZE);
But if imagine that's not the best way to do that. I know I can iterate through stdin and just use realloc to increase the buffer size, but I'm forbidden from using realloc, due to project specifications, which say I can only use malloc, read, write, open and free.
Is there any other way out? thanks!
reallocpurely withmallocandfree.