I am creating a console program that asks for users to input integers between 0 and 100 and then outputs each number and how many times is was entered. Each number the user enters is separated by a space and input ends when 0 is entered. So far i am using cin.getline to store the numbers in a character array. This limits the ability to manipulate the numbers as they are stored as ascii characters. If the user types in 10 i want to be able to store 10 into a new array as a single integer, such as s[i]=converted_number.
I am creating a console program that asks for users to input integers between
Share
Instead of using
cin.getlinesimply do:That will get you the input in integer form.