Does anyone know where I can find a manual page for the system(); function? I can't find one. Usually it is just a "man fgets()" google away, only in this case system. But I can't find anything on it.
Does anyone know where I can find a manual page for the system(); function? I can't find one. Usually it is just a "man fgets()" google away, only in this case system. But I can't find anything on it.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Well, thats weird because the 2nd link I actually went to that site and searched, I guess I just over looked it. Well, I still can't figure out the return value. Because eveytime I try to compile I get an error. Could someone paste a simple piece of code or help me out. I just need to figure out how to get the return value.
What error do you get?Because eveytime I try to compile I get an error.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Code:#include <stdlib.h> int main () { int ret = system("1.bat"); return 0; }
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Ah, you are a god. I feel like a total moron looking at that. But thank you very much.
how about this???
for windows 9X:
system("C\\Windows\\Desktop\\filename.exe");
for windows NT:
system("C\\Winnt\\Desktop\\filename.exe");
for windows XP:
system("C\\Document and Settings\\Current User\\Desktop\\filename.exe");
for windows VISTA:
system("C\\Users\\Current User\\Desktop\\filename.exe");
And how are you going to determine which operating system the user is running? And what about colons, like C:?
It should be noted that separate system() calls are independent of one another. Each system() call starts its own shell, which, in addition to being quite inefficient, means that calling system("cd whatever") will have no effect whatsoever on any system() calls following it.
The non-standard chdir() can be used to change the directory. I'm not sure what the Windows equivalent is.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.