I have a file containing the number 1. I want to make a program that reads the number in the file, and then replaces the number incremented by 1.
so far I have this, but it does not seem to work, the file remains unchanged
file >> number;
file << number+1;