Originally Posted by
Salem
That is only true of DOS .COM files.
Almost right (it is true of more than just COM files), but my half-true statement was merely the result of an attempt to illustrate how the OS handles the command line, while your implication that it has a virtually unlimited length is completely unfounded. See the attached program. The code follows. Included is a batch file with a couple of very long command line arguments. Try running it. If what you're saying is correct, every character in the command line will be printed.
Code:
#include <iostream>
using namespace std;
int main(int argc, char **argv) {
cout << "Here are our command line arguments:" << endl;
for (int i = 0; i < argc; ++i)
cout << argv[i] << endl;
cout << endl;
return 0;
}
Originally Posted by
CornedBee
And it might yet again be different in ELF executables and a.out executables.
By
Originally Posted by
LuckY
On an x86 machine...
I meant on an x86 Windows machine. Obviously different operating systems don't all manage executables in an equivalent manner.