Hello semsemdiver,
My apologies I believe I missed telling that
std::tolower()
and
std::toupper()
need the header file "<cctype>". Although it is the first line of code. I am not sure what happened to cause this error unless you missed copying that line.
The error message:
'tolower' : is not a member of 'std' |
is the first indication that the header file is missing. It is saying that it can not find anything, i.e., the prototype, that matches its use.
You tend to see the same thing when you use "std::string" and forget the header file. Also with "std::string"s when you forget the header file a "cout" statement will produce an error message:
C2679 binary '<<': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
|
Once you get use to the error messages they are a great help.
The line
while (std::tolower(again) == 'y');
does work with the proper header file.
You may not have covered the header file "<cctype>" in class yet, but in the future, near future, you will find it very useful. Along with the header file "<iomanip" which works with "<iostream>".
I am not sure what year VS 6 came out, but you might want to consider updating to the VS 2017 Community version. The IDE does have the ability to detect errors before you compile to give you a chance to fix them. Just a thought.
your warning about including even <iostream> disappointing me, that means i should or must know what every header file and namespace exactly do? and to know how to call or use its classes and functions without including it in my code file !! it is too much effort and details !
|
I may be getting ahead of what you know, but I am speaking about the day when you learn about creating your own header files. Include files like "iostream" and "string" should always be in the ".cpp" files. Beyond that you do not have to know everything that is available in a header file. In some of the header files there may be only one or two things that you may ever use. The rest can be learned as you progress. You can always find someone's code here to spark an idea or see how something new is used.
It is all part of learning what each header file contains and what functions you can use. In the top left of this page there is a link "References" that I use quit often to learn what is in a header file or use it as reference to see how some function is used. After that time an repetition you will learn what you need and find newer things that you can use.
Hope that helps,
Andy