strtol / strtod usage question
First, I've used strtol many times but never have I seen someone pass a NULL for the second value which should be a char** for stopstring. If the conversion fails, will the program crash? Will an exception be thrown? Is this call to strtol correct? Is it ever appropriate to pass NULL for the char**?
Second, I do not believe strtol throws an exception at all. But this is more of a followup to the first question. If a valid char** was passed (like it should be in my opinion), could any kind of exception ever be thrown for that line of code? If so, what exception? I'm wondering if calls to c-run time functions should ever be contained in try catch blocks. I'm having a hard time deciding when to put code in a try catch block when dealing with these types of system library calls.
This is code I have seen and my thought is to go ahead and provide a stopstring and then provide error checking based on the value of the resulting stopstring and get rid of the try...catch blocks. Does anyone disagree with that?
try
{
lResultStore = strtol(argv[i+1], NULL, 10);
}
catch (...)
{
//error handling would go here
}

