Hello! I am a beginner at C++ and have to write a program that takes a Roman Numeral input and then converts it regular numbers. Currently I am trying to use toUpper (which I have no experience with) to make all of the input convert to uppercase so that it is easier to parse, validate, etc...For example, if the user inputs "iii" it should convert to "III".
The problem I am getting is that it is only storing the first character in the string...any suggestions? Here is a snipet of my code
@LB - Brilliant! Thanks so much. That worked out well.
For the sake of knowledge however - if I wanted to convert that using toupper without using #include <algorithm>...what would be the proper way to do it?
The proper way is to use <algorithm>, but I'm assuming you meant 'how do I reinvent the wheel'. Basically you would just loop over each character in the string and apply toupper to it. This means you assign a new value to the character, which is the return value of calling toupper with the character as a parameter.
@LB thanks again! That makes sense. I see that it is way more effective to just use <algorithm>. Now I have a question about parsing a string for my validation in my program but I will open another post for that since it's not related to toupper.