im trying to get my program to open exe's but it keep coming up with errors about this line: (open ios::in, ios::binary); i keep getting this error message: parse error before `::' token if anyone knows whats wrong plz post
im trying to get my program to open exe's but it keep coming up with errors about this line: (open ios::in, ios::binary); i keep getting this error message: parse error before `::' token if anyone knows whats wrong plz post
post your program...
my program is too big to post but ill post the section where the broken code is
Code:if (command=="openmirc") { ifstream fin; fin.open("c:\progra~1\mirc\mirc.exe"); ("c:\progra~1\mirc\mirc.exe" ios::in, ios::binary); if (fin.fail()) { cout << "Error Could not open mIRC.exe" << endl; }}
im thinking is how u do the brackets. the brackets look wrong well thats what i think i dont know to the pros though
im still a noob but im trying my best to understand and trying to help
This is supposed to do what exactly?Code:("c:\progra~1\mirc\mirc.exe" ios::in, ios::binary);
Maybe you mean this:
I believe that will workCode:if (command=="openmirc") { ifstream fin; fin.open("c:\progra~1\mirc\mirc.exe",ios::in|ios::binary); //("c:\progra~1\mirc\mirc.exe" ios::in, ios::binary); if (fin.fail()) { cout << "Error Could not open mIRC.exe" << endl; }}
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
why did u have to make that a comment?? shouldnt that be part of the program?Code://("c:\progra~1\mirc\mirc.exe" ios::in, ios::binary);
im still a noob...
....but im trying my best to help people out
...doing that will help me understand more and more about c++
Nope, I can't see how that line could work, I think he meant to open the file with the flags ios::in and ios:binary, so AFAIK you can OR them together using the open(file,flags) function
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
ok it dont come up with errrors anymore but it also doesnt open mirc.exe, sugestions anyone
Last edited by darchonius; 08-23-2003 at 03:31 AM.
You need to use "\\"...
Code:fin.open("c:\\progra~1\\mirc\\mirc.exe",ios::in|ios::binary);