In C, when I am reading a file, or some other input, all at once with fread
how would I know what size to declare the buffer with?
char buffer[1024];
fp = popen("ls /", "r");
fread(buffer, 1, sizeof(buffer), fp);
The input data could have 1000 lines or 1 line, or even 100000 lines or more.
Is there any general rule for it?