I am trying to copy a text file to another file, but inserting a line number at the beginning of each line.
an example of this...
original file:
Hello C Programming Board
I need your help with this.
Thank you in advance.
new file:
1. Hello C Programming Board
2. I need your help with this.
3. Thank you in advance.
I know how to copy file to file, but don't know where to start when it comes to inserting a number before each line. My theory is to create a variable such as a numCount. Everytime I run into a \n I can fprintf numCount and then numCount++. I am not even sure if it's fprintf.
If someone can guide me through this I would greatly appreciate it. Thanks again!