Questions tagged [tolower]

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.

148 questions
1
vote
2 answers

tolower for C-style strings

I'm trying to perform case insensitive strcmp on two C-style strings. I have a function to convert C-style strings to lowercase. char* ToLowerCase(const char* str) { char buffer[strlen(str)]; for (int i=0; i
Ilo
  • 35
  • 6
1
vote
2 answers

upper to lower and vice-versa without loop in C++?

Input: abcdE Output: ABCDe I am looking for an efficient and less code solution for this code: #include #include using namespace std; int main() { int len, ; string data; cin >> data; len =…
1
vote
0 answers

Controlling column name case - using fread from .txt to data.table

I have many years of data to read from .txt (tab delimited) to data.frame or data.table formats to work in R. For each year, quarterly files need to be appended. My searching has resulted in some nice code to find all quarterly files and, using…
Anjeg
  • 23
  • 4
1
vote
1 answer

Convert char to lowercase in batch

I am having trouble trying to convert a windows path into the cygwin-style linux like path. C:\path\to\file will be /cygdrive/c/path/to/file for instance. I have everything working except for converting the uppercase drive letter pulled out of the…
Drew
  • 93
  • 10
1
vote
1 answer

Integrate counter in awk and lower value of specific column

I am trying to incorporate 2 functions into my awk command. I want tolower the information in Col1 in a Column 2 (thus the information in Col1, will be the value of 2 cols - Col1 and Col2, with the values in lower in Col2) and I want to count from…
owwoow14
  • 1,694
  • 8
  • 28
  • 43
1
vote
2 answers

Trouble bubble sorting alphabetically in struct array

When trying to bubble sort an inventory stored in a struct array, I am getting two different errors when I compile the code below: void SORT_INVENTORY(Books* list, int max, int position) { bool swap; string temp; do …
jshapy8
  • 1,983
  • 7
  • 30
  • 60
1
vote
1 answer

implicit declaration of function 'toLower', already included

I keep getting these 2 compilation errors in my program. word_freq_binary.c: In function 'getWord' word_freq_binary.c:36:4: warning: implicit declaration of function ‘toLower’ str[n++] = toLower(ch); ^ tmp/ccYrfdxE.o: In function…
user1798299
  • 173
  • 2
  • 4
  • 12
1
vote
5 answers

How to use .ToLower() properly in this case?

So what I'm attempting to do is have this program ignore a user's letter case when entered. I see how to use .ToLower(); however I'm not understanding how to do this the right way. Here's what I have now, am I close? I've read a bunch of tutorials…
user3554677
  • 35
  • 1
  • 6
1
vote
2 answers

How to convert a csv file to lowercase/uppercase maintaining its structure?

I have a csv file with some columns, each column has values written in different ways, such as "Car" and "CAR". I wish to convert all values to lowercase, I'm using this code: data <- read.table(pipe("cut -d' ' -f6 iis_raw.csv")) data <-…
Thiago Vieira
  • 126
  • 4
  • 16
1
vote
2 answers

Umbraco NiceUrl ToLower

Funky
  • 12,890
  • 35
  • 106
  • 161
1
vote
3 answers

tolower() function problems

this is my example code: #include #include #include void convert(char *a, char *b) { int i; for(i=0; i
giozh
  • 9,868
  • 30
  • 102
  • 183
0
votes
0 answers

Why will not my code print to the output text file the characters in the input text file with lowercase letters becoming uppercase and vice verse?

I am trying to create a code implementing pipelining to get the characters in an input file ("input.txt") and have the program capitalize the lowercase letters and vice versa. Here is my code: #include #include #include…
0
votes
0 answers

what is for(auto& x : s) in C++

Since I am new to C++, I do not know what the expression means? and how can i co-relate this expression with C language. #include using namespace std; …
0
votes
1 answer

What is under the hood of std::tolower?

I wast just reading about std::tolower in CPP-Reference. Is std::to_lower maybe just a wrapper of a std::use_facet function? Please see the following example? #include #include int main() { char c1{ 'A' }, c2{'B'}; …
A M
  • 14,694
  • 5
  • 19
  • 44
0
votes
2 answers

Filling the \0 spaces of an array with 'x'

I'm new to C programming so if anything looks super wrong I'm sorry! I need to make my array ( str[512] ) to be exactly 512 characters long after taking input from a text file with an unknown number of characters. After the text file input, there is…