Wow, sorry. That was a typo on my part. It should be:
Code:
#include <sstream>

...

stringstream out;
out << argv[1];


if (!(out >> stackSize))
{
    cerr << "Bad command line argument.\n";
}
If the stackSize is bad then you can exit the program or use a default value or whatever you want inside the if.