atoi() and stoi() are both functions in C++ that are used to convert strings to integers or integers to strings.
Comparison chart
Uses
stoi() function is used to convert a string into an integer. It is used in C++ since the 11th version. This type of function makes converting strings to integers much easier.
In order to use it, you would need to declare a string and then use that string as an argument in stoi() function. Lastly, you would need to use the cout function to display the result. If you don't want to display the result, cout function is not necessary.
atoi() function is used to convert an integer into a string. It is also one of the newer functions and is used since C++ 11th version. This function was created to make it easier to convert integers into strings.
Its use is very similar to stoi() function: you would first need to declare the integer and then use the declared name as an argument in atoi() function. If you want your output to be displayed, you will need to use the cout function as well.
Comments: Atoi() vs Stoi()