You can still use system() if you want. All it does is pass the string to the command shell, so the string has to look like it would in the command prompt. For names with spaces, wrap the path in double quotations:
#include <iostream>
#include <string>
#include <cstdlib>
int main()
{
using namespace std;
string cmd = "type ";
string filename;
cout << "Type a filename: ";
if (getline(cin, filename))
{
system((cmd + "\"" + filename + "\"").c_str());
}
}