If you wish to make the file larger, then you simply seek to EOF and start writing.
If you wish to make the file smaller, then things get hairy. Most systems have an OS API function that will truncate a file to a smaller size. If not, or if you wish to do it in pure C/C++, you will have to read the entire file into memory, close the file, reopen it as REWRITE, and write out only as many bytes of the file you wish to keep.