Originally Posted By: peter
Your snippet with _ttoi looks correct, as long as the program has been invoked with at least two parameters.


I'm so stupid. I'm going to go bury my head in the sand.

It's a zero based index problem. And (correct me if I'm wrong) the fact that the argc parameter is a count which is different from the index into the argv array.

argc is the count. Which is, in my case "2". Because the first parameter is the EXE name and the second parameter is my parameter I typed in. My "if" statement works and prevents the program from continuing if you didn't put in at least one parameter.

So, with argc happily at a count of "2", and validated as such, I go on to read the second parameter of the array. Since I just validated the count at "2", I should be able to read argv[2] right? There's just no way it could try to read past the end of THAT ZERO-BASED-INDEXED ARRAY could it?

Gah. :-)

It's working now. I'm so stupid.
_________________________
Tony Fabris