In C / C++ tolower function converts a given character to lowercase according to the character conversion rules defined by the currently installed C locale. In the default "C" locale, the following uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ are replaced with respective lowercase letters abcdefghijklmnopqrstuvwxyz.
Questions tagged [tolower]
148 questions
-1
votes
2 answers
Trouble with converting string to lowercase/counting words in C
In my third function I am getting a syntax error at const char* it = s; when I try to compile. My friend got this program to work on his compiler, however I am using Visual Studio and it will not compile. Any and all help would be MUCH appreciated!…

DJ87
- 11
- 1
- 1
- 2
-1
votes
1 answer
scanning numbers into string in c
I have a list of words lets say:
Hello
FAR
DC2012
I need to scan all of these as strings and put them into a binary tree. Except whenever I scan , my program fails at the third string "DC2012". I'm guessing it is because it has numbers and I'm…

dwong
- 57
- 1
- 3
- 7
-2
votes
1 answer
How to use toUpper and toLower in Haskell without importing module Data.Char?
So I am trying to write my own functions without help from imports and i am struggling to have a function that works the same way.
Here is what I have.
toLower'' :: [Char]-> [Char]
toLower'' [] = []
toLower'' (x : xs)
| x `elem` ['a' .. 'z'] =…
-2
votes
3 answers
How can I use the toupper or tolower function on a string array
I was wondering how to use the toupper function so when the user can type in these words any way they want.
//fill in arrays
word[0] = "VERY";
word[1] = "MERRY";
word[2] = "CHRISTMAS";
word[3] = "EVERYONE";
for…
user12743659
-2
votes
3 answers
C++ towlower comparison with original character fails?
I have the following code in C++:
string StringTest = "Test";
bool OriginalWord = true;
for (unsigned int i = 0; i < StringTest(); i++) {
string Character = towlower(StringTest[i]);
string CharacterOriginal = StringTest[i];
if (Character…

TVA van Hesteren
- 1,031
- 3
- 20
- 47
-2
votes
2 answers
How to extract a string that is present before ".lower" in c#?
I have a string like
string variable1="EXAMPLE";
and later somewhere in my code, I use like
Console.WriteLine(variable1.ToLower());
I may use variable1.ToLower() multiple times. But now I want to store the variablename that is converted to Lower…

Vedh
- 93
- 1
- 10
-2
votes
3 answers
changing int main to void
I have written a working program but the form is incorrect for the task. Can somebody please help me change the code to
"void lower(char* s)"
Tried to change and position it but no working outcome. Doesnt fully understand the void type and one…

realmean
- 7
- 1
-3
votes
1 answer
toupper and tolower with pointers
I am trying to figure out how to use toupper and tolower using pointers. I thought I was on the right track. I managed to get the pointers correct for the uppercase letters but for some reason, it won't work for the lowercase. Any advice would be…

Drew
- 23
- 1
-3
votes
2 answers
Why is putchar(tolower(ch)) printing out two of each character?
This is my code, and each letter of the output is being printed twice. It is not the text file and it only happens when I insert my putchar(tolower) statement in but it is formatted exactly as it should be. What is wrong with the statement?
#include…

math
- 13
- 2
-4
votes
3 answers
toupper tolower not working , help what's wrong with my code
main.cpp
#include
#include "Module2.h"
int main()
{
std::cout<<"This is a test of Module2.h"<

goInDoor
- 1
- 3
-5
votes
3 answers
Changing upper to lower and lower to upper
I am new in c programming. I would like to ask if this function is ok,
because I don't know how to check this in main.
char uppertolowertoupper(char ch)
{
if (ch>='A' && ch<='Z')
{
ch=tolower(ch);
return ch;
}
else…

uppermost
- 1
- 5
-6
votes
2 answers
Unit testing for a function (tolower) using pointers
I have this function that changes the string to all lower cases.
I am trying to create a unit test for this function, but I think I am passing the argument wrong, and I get this error.
Segmentation Fault (core dumped)
This is my code.
void example…

neko_studies_prog
- 133
- 1
- 1
- 5
-8
votes
3 answers
Create your own toUpper and toLower in C
When I run and compile the code, I get errors that A and Z, and a and c are both undefined, how do I fix this ?
char toUpper ( char c ) {
if ( C >= a + c <= z)
-32;
return c;
} // ends toUpper
char toLower ( char c ) {
if…

Anthony Paliseno
- 75
- 1
- 6