Questions tagged [toupper]

In C / C++ toupper function converts a given character to uppercase according to the character conversion rules defined by the currently installed C locale. In the default "C" locale, the following lowercase letters abcdefghijklmnopqrstuvwxyz are replaced with respective uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ.

176 questions
-3
votes
1 answer

cast from pointer to integer of different size. compile error

When I try to use toupper, the compiler gives me this error: "warning: cast from pointer to integer of different size." and "warning: assignment makes pointer from integer without cast." Why? for(i=0;i
Ricky Yang
  • 23
  • 2
-3
votes
1 answer

Using toupper function

#include #include #include #include #include #define SIZE 5 void select_word(const char *const art[], const char *const noun[], const char…
-4
votes
2 answers

How would you convert alpha characters to n string to uppercase in C?

This is what I have so far. I'm just trying to understand how to implement this function. char toupper(char s[]) { s[50] = "hello"; int i = 0; int len; len = strlen(s); while(i < len) //converting to upper until the length is reached. …
dsb4591
  • 39
  • 1
  • 4
-4
votes
2 answers

do while loop where the choices use toupper in C++

Is there a simple way to convert the char choice from a lower case q to upper case Q? I've tried the c version of toupper but I can't get it to work in C++. I need it that all the characters typed in will be upper case; so, they link to the choice…
Gus
  • 69
  • 5
-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
-4
votes
2 answers

Uppercase problems

How can I output this when I'm using Replace and ToUpper in visual studio c# FirstName Here's my code: private void button1_Click(object sender, EventArgs e) { string input; input = comboBox1.Text; input = input.Replace("_", ""); …
Amped
  • 1
  • 1
-5
votes
2 answers

Convert first 2 letters of all records to Uppercase in python

I have a dataframe DF with just 1 column and I want to uppercase first 2 letters of all the records in python. how do I do that ?
Yuvraj Singh
  • 37
  • 1
  • 1
  • 6
-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
1 answer

Loop not accepting lowercase even with toupper (C++)

Currently, I want my code to accept lowercase or uppercase a, b, c, or u as a valid entry from the user. However, anytime I enter the characters as lowercase, they respond with the error message and continue the loop until it is put in uppercase. I…
-8
votes
1 answer

C++ How do you make every third letter of a char array into an uppercase letter?

At the moment I have figured out how to make every vowel into a '!' and it does work. I have used a bool isVowel() function for that. Now I want to uppercase every third letter. My array is char aPhrase[15] = "strongpassword": while…
-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…
1 2 3
11
12