-1

i know there are a couple of questions similar to this one out there but and while i have browsed through them, none have been able to resolve my problem. My code takes in three strings as parameters

on cmd

volume.exe NameOfInputFile.txt string1 string2

the code

int main(int argc, char* argv[])
{
   string s1=argv[2],s2=argv[3];
   fstream file;
   file.open(argv[1],ios::in);
   ..rest of the code..
}

this works fine on the terminal in linux as

./volume.exe NameOfInputFile.txt string1 string2

but how do i get it to work on windows? I tried this but did not work

start /b /d volume.exe NameOfInputFile.txt string1 string2

2 Answers2

0

Try this by surrounding the name of file NameOfInputFile.txt in quotes you pass it as string argument and not as a file.

start /b /d volume.exe "NameOfInputFile.txt" string1 string2
0

Try this one:

start /b /d "volume.exe NameOfInputFile.txt string1 string2"
deming
  • 101