| | |
tolower
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2009
Posts: 3
Reputation:
Solved Threads: 0
Sorry in advance if there's already a thread or if i've posted in a wrong section(??).
My question:
If i use the tolower function can i use the newly editted input and put it back to where it came from??
In effect - clarity isn't my strong point today
I've got a simple "do" loop that offers a restart option but only if the while criteria !=n is met. I want to get it to either accept 'N' or to read input -> change to lower case -> accept the now lower case.
Did try while ((Choice !='n')||(Choice !='N')); but it got stuck in loop.
Either solution type would be helpful. Muchos er Thankos
My question:
If i use the tolower function can i use the newly editted input and put it back to where it came from??
In effect - clarity isn't my strong point today

I've got a simple "do" loop that offers a restart option but only if the while criteria !=n is met. I want to get it to either accept 'N' or to read input -> change to lower case -> accept the now lower case.
Did try while ((Choice !='n')||(Choice !='N')); but it got stuck in loop.
Either solution type would be helpful. Muchos er Thankos
•
•
Join Date: Nov 2008
Posts: 394
Reputation:
Solved Threads: 72
I think you need either:
Note the && (and).
OR:
Also please note you are very unlikely to need the ; after the while
unless it is in a
Whatever you want executed goes in the brackets.
while(Choice!='n' && Choice!='N') { } Note the && (and).
OR:
while(tolower(Choice)!='n') { } Also please note you are very unlikely to need the ; after the while
unless it is in a
do { } while (condition); construction.Whatever you want executed goes in the brackets.
experience is the most expensive way to learn anything
![]() |
Similar Threads
- How does one tolower an entire string? (C++)
- simple tolower() and reading a text from the input (C++)
- tolower()'d cstrings in conditional statements (C++)
- What is the error in sorting names and tolower function? (C++)
Other Threads in the C++ Forum
- Previous Thread: Help with Class
- Next Thread: strtok and linked list help
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





