Stuck on a quick console app
Hey guys its me again. Im here to pick your brain! I wanted to make a really small console app that just requests for a hostname of a computer and uses a cmd promp command to open up a unc connection.
Im writing this from my phone so this will be rough. Due to web security at my job. When I get home I will refine it. My phone is going to capitalize alot so void some of the syntax.
static string pcname;
int main ()
{
cout << "UNC PATHER \n";
cout << "Hostname to path? \n>";
cin >> pcname;
system (("start " + "\\" + pcname + "").c_str ());
system ("exit");
return EXIT_SUCCESS
}
1. In function 'int main ()':
2. I got an error output showing "invalid operands of types 'const char [7]' and 'const char[2]' to binary 'operator+'.
3. [Build error] [main.o] error 1.
Can anyone help out with this?
Im writing this from my phone so this will be rough. Due to web security at my job. When I get home I will refine it. My phone is going to capitalize alot so void some of the syntax.
static string pcname;
int main ()
{
cout << "UNC PATHER \n";
cout << "Hostname to path? \n>";
cin >> pcname;
system (("start " + "\\" + pcname + "").c_str ());
system ("exit");
return EXIT_SUCCESS
}
1. In function 'int main ()':
2. I got an error output showing "invalid operands of types 'const char [7]' and 'const char[2]' to binary 'operator+'.
3. [Build error] [main.o] error 1.
Can anyone help out with this?