I tried to run the code (saved as 1.cpp, see at the end) in my linux:
I input in the terminal: g++ 1.cpp
Then ./a.out hello.txt
I thought it would output the file of hello.txt. However, the result is that it indeed outputs the file. But before the content of file, there are garbage characters. I just don't know why. Any kind of help would be appreciated!