What I am really trying to do is rename a large group of files with #'s, e.g. 001.doc, 002.doc, etc.. please help, newbie.
What I am really trying to do is rename a large group of files with #'s, e.g. 001.doc, 002.doc, etc.. please help, newbie.
there is no function that i know of, but you can do it with a system call - as for renaming it with a number - use a variable that you increment and then use that as the filename (use a pointer to it)
if you have an uncertain number of ilfes to rename you can use a while loop
Monday - what a way to spend a seventh of your life
rename
Syntax:
#include <stdio.h>
int rename( const char *oldfname, const char *newfname );
The function rename() changes the name of the file oldfname to newfname. The return value of rename() is zero upon success, non-zero on error.
http://www.cppreference.com/
Hope that helps
Open the file, read it into the new as if you were reading the lines into strings in your program, then delete the old one.