I am working With files. Currently I am sequentially renaming some files I know a little about fstream. I simply want to rename multiple file sequentially with loop.Why this code is not working? Is there any another way to do? i just want to done my job. Thank you for reading <3
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
// not working
for(int i=1;i<=20;i++;){
rename(("oldname"+to_string(i)+"txt"),((newname+to_string(i)+"txt"));
}
return 0;
}