title: Return value in atoi function
body: <p>Currently I have an Atoi function in Java which returns an int value on passing a string input. The initial return value is set to 0. However, the value returned will be 0 if invalid characters or all characters are passed in input string and if the actual string passed is just "0". How can I use return values for these two cases? Or is this okay and I should leave it upto the client to handle this ?</p>