C++ Program to Convert String to Integer
Given a string of digits, the task is to convert the string to an integer. Examples:
Input : str = "12345" Output : 12345 Input : str = "876538"; Output : 876538 Input : str = "0028"; Output : 28
Time Complexity: O(|str|)
Auxiliary Space: O(1)
How to do using library functions? Please refer Converting Strings to Numbers in C/C++ for library methods.