Given a string of digits, the task is to convert the string to an integer.
Input : str = "12345" Output : 12345 Input : str = "876538"; Output : 876538 Input : str = "0028"; Output : 28
How to do using library functions?
Please refer Converting Strings to Numbers in C/C++ for library methods.
- How to convert a single character to string in C++?
- Convert string to char array in C++
- Program to convert IP address to hexadecimal
- Convert a floating point number to string in C
- Program to convert the diagonal elements of the matrix to 0
- How to convert C style strings to std::string and vice versa?
- C++ program to Convert a Matrix to Sparse Matrix
- Program to extract words from a given String
- Program to reverse words in a given string in C++
- C++ Program to compare two string using pointers
- Program to find the kth character after decrypting a string
- Program to reverse a string (Iterative and Recursive)
- C++ Program to count Vowels in a string using Pointer
- Program to replace every space in a string with hyphen
- Program to Parse a comma separated string in C++
- C program to copy string without using strcpy() function
- Program to find the product of ASCII values of characters in a string
- Smallest integer > 1 which divides every element of the given array
- std::string::crbegin() and std::string::crend() in C++ with Examples
- How to convert a Vector to Set in C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.