Hi,
i have a problem. I want to rename multiple files, and they are named like scan1.pdf scan2.pdf, scan3.pdf and so on. I want to change only the numbers at the end of the file.
I used this code for renaming one file
Code:
#include <stdio.h>
int main ()
{
int result;
char oldname[] ="oldname.txt";
char newname[] ="newname.txt";
result= rename( oldname , newname );
if ( result == 0 )
puts ( "File successfully renamed" );
else
perror( "Error renaming file" );
return 0;
}
i would like to if there is any way, that i could use
for (i=1,i<=n,i++) and put the parameter i in the oldname.txt?
I hope you understood.
cheers