I need to write something into a txt file and read the contents, then print them on the screen.
Below is the code I have written, it can create and write contents into file
because the file pointer (not the one used for memory allocation) has moved to the end. To read from the file, you have to bring it to the front with the fseek function.