This is an embarrassingly simple question, but I can't seem to recall or find a standard function to do what I want, and while I could do it by hand, I'd rather not.
The Problem:
I have a string which [hopefully] contains a integral number. I want to convert it to an int, but I also want the following:
- I want some kind of failure if the string is ill formed (contains non numerical characters, bad whitespace, etc)
- I want hex/oct prefixes to be parsed appropriately (ie: "0x12A5" and "034")