Wow, miss a few weeks...
I don't know if you noticed what caused the problem, but
only works if your input stream is completely read and waiting for the user to type something. After using
cin >> foo;
that is not the case. Try thecoolguy98
's method and see if that helps:
cout << "Press ENTER to continue...";
cin.ignore( numeric_limits <streamsize> ::max(), '\n' );
Don't worry so much about all the TCHAR and PROCESS_INFORMATION and the like --it's all Windows boiler-plate.
() functions arguments are
The number of c-strings in the argv
Each piece of the command-line that invoked your program.
The first item (index 0) is the name of your program.
The second item (index 1) is the first argument to your program.
Try playing around with it:
using namespace std;
int main( int argc, char* argv )
cout << "arguments:\n";
for (int cntr = 0; cntr < argc; cntr++)
cout << cntr << ": " << argv[ cntr ] << '\n';
The program name is also considered an 'argument' because it is part of the command used to invoke your program. Try running your program from different directories to see how it affects argv.
D:\prog\cc\foo\args> a.exe one two three
D:\prog\cc\foo\args> a Hello world!
D:\prog\cc\foo\args> cd ..
D:\prog\cc\foo> args\a "John Jacob Jingleheimer Schmidt"
1: John Jacob Jingleheimer Schmidt
When you are done playing with the command-line, try double-clicking the executable from Explorer (or from the window manager if you are using Linux or Mac).
 Oh, you'll have to add that pause function and use
before you try it from your WM. heh.[/edit]
Hope this helps.
 Added "using namespace std" to the example. (Sorry I forgot that last time.) [/edit]