I'm testing out how to open files with C++ and I've come across a problem. It seems when I try to open a path that has no spaces in it, it works fine. But when I try to open a path with spaces it has an error message that says could not open file and it spouts the path but it stops short where the space is and doesn't seem to read the link after the space occured. Does anyone know what I'm doing wrong?
For instance this does not work:
Code:#include <stdafx.h> #include <iostream> using namespace std; #include <fstream> int main() { system("START C:\\Program Files\\FlashFXP\\FlashFXP.exe"); }
This one DOES work:
Code:#include <stdafx.h> #include <iostream> using namespace std; #include <fstream> int main() { system("START C:\\WINDOWS\\notepad.exe"); }




Reply With Quote