#include <iostream>
#include <string>
#include <sstream>
#include <windows.h>
#include <vector>
using namespace std;
int main() {
string PNGFilePath, WEBPFilePath;
int number, c;
char title[256];
cout << "Enter a Number: ";
cin >> number;
cout << endl;
cout << "Title: ";
cin.getline(title, 256, ';');
cout << "Enter PNG directory: ";
cin >> PNGFilePath;
cout << endl;
cout << "Enter WEBP directory: ";
cin >> WEBPFilePath;
cout << endl;
std::string OldPNGFolder = std::string(PNGFilePath + "\\");
c = 1;
while (title[c] != '\0') {
OldPNGFolder += title[c];
c++;
}
std::string NewPNGFolder = std::string(PNGFilePath + "\\[");
c = 1;
NewPNGFolder += to_string(number);
NewPNGFolder += "]";
while (title[c] != '\0') {
NewPNGFolder += title[c];
c++;
}
MoveFile(OldPNGFolder, NewPNGFolder);
}
I tried adding "(OldPNGFolder.c_str()" and it still shows the same error message, also tried system(OldPNGFolder.c_str()); and still the same message.
Adding "LPCTSTR" shows the error "error: expected primary-expression before 'OldPNGFolder' MoveFile(LPCTSTR OldPNGFolder, NewPNGFolder);"
Is there a way to fix this???