For one of my homework, I have to read a file (~100 lines). To manipulate the content of the file and extract all the lines, I allocate a buffer with the size of the file with the function stat. And I read the file with the function read with this buffer. I was told that this method was dirty.
Why is it considered to be dirty? I think that if the file is short, it means the size of the char array is acceptable and it means only a few syscall??