I'm asking a user what filename they're wanting to work with then wanting C++ to issue a system command like it was being run from the command prompt.
This should be simple enough but can't seem to get it right. Here's some code I have:
string FileName;
cout<<"What is the file you want to work with?: "<<endl<<endl;
cin>>FileName;
system("ren FileName test.txt");
Doing this tells me the file is not specified but the file is there so I don't know why it won't work.
Not sure if I'm doing the 'system' command correctly?
Does anyone have any suggestions for this?
thanks in advance!
This should be simple enough but can't seem to get it right. Here's some code I have:
string FileName;
cout<<"What is the file you want to work with?: "<<endl<<endl;
cin>>FileName;
system("ren FileName test.txt");
Doing this tells me the file is not specified but the file is there so I don't know why it won't work.
Not sure if I'm doing the 'system' command correctly?
Does anyone have any suggestions for this?
thanks in advance!