adding variables to the system() command
I would like to do this:
String name;
cout<<"Enter file name and path: ";
cin>>name;
system ("start name");
I realize that this won't work, since the program would go looking for a file called 'name'. But I don't know how to add variables to the system() command. So if anyone could give me an example of code that does this, I'd be greatly appreciative.
{By the way, I am using MSVC++, I have already tried using ShellExecute() [which gave me errors just by including the shellapi.h library], and I do not want to open .txt files.)
Thanks
String name;
cout<<"Enter file name and path: ";
cin>>name;
system ("start name");
I realize that this won't work, since the program would go looking for a file called 'name'. But I don't know how to add variables to the system() command. So if anyone could give me an example of code that does this, I'd be greatly appreciative.
{By the way, I am using MSVC++, I have already tried using ShellExecute() [which gave me errors just by including the shellapi.h library], and I do not want to open .txt files.)
Thanks
