answersLogoWhite

0


Best Answer

To change any string to uppercase, loop through each character in the string. If the character is in the range 'a' through 'z', decrement the character by decimal 32 (the difference between ASCII value 'a' and 'A'). The following function shows an example of this:

void to_upper(std::string& str)

{

for(int i=0; i<str.size(); ++i)

if(str[i]>='a' && str[i]<='z')

str[i]-=32;

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Changing a word to all uppercase letters in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the Uppercase character of the word captain?

Enter the Uppercase character of the word "capTain"


What is the Uppercase character of the word of capTain?

Enter the Uppercase character of the word "capTain"


I am looking for a font that has all the uppercase letters uppercase and forward and all the lowercase letters lowercase and backward extra info I am trying to make a 2 word palindrome thst spins?

I don't believe there is such a font available. The easier way - would be to create the palindrome using Microsoft Paint. You can manipulate the letters as you see fit.


What are classification of letters?

Letters can be classified based on their position and function in a word: vowels (a, e, i, o, u) and consonants (all other letters). Additionally, letters can be classified based on their shape: uppercase (capital) letters and lowercase letters.


What group of letters coming after the root word and changing the meaning is called a?

Your're looking for the word suffix.


Should the word astronomy be uppercase?

No, it shouldn't all be uppercase, and it doesn't need to be capitalized unless it is the first word in a sentence or part of a title.


Without changing the order of the letters what can the word 'saved' be changed into or what letters can be added to it?

shaved slaved, staved starved misbehaved


When you write the word police in a sentence does it have to be uppercase?

No.


7 letter word you can make 10 words from with out changing the order of the letters?

therein


What is that game that you add pictures plus letters to equal a word?

Concetration


What is the correct way to spell 'WikiAnswers'?

The correct spelling is indeed this: WikiAnswers - one word; no hyphen' uppercase "W" and uppercase "A."


Sounds like a resident in the garden of eden?

Atom (changing 2 letters of the word adam)