concatenate the two strings before calling system
string fname;
string pick;
cin>>fname;
cout<<"Do you want to open the file?";
cin>>pick;
if(pick=="yes")
{
string command;
command = "umplayer.exe " + fname;
system(command.c_str());
}
else
cout<<"Thanks for your time;
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
concatenate the two strings before calling system
PERFECT thanks a million
Gee, what was it I said? Oh yeah,Concatenate "C:\\wmplayer.exe " and fname into a char* and use that variable. :icon_rolleyes:
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944