Re: toupper Programming Software Development by DavidB toupper is a built-in function in C++, defined in <cctype>, so it should be accessible throughout the program. Unless you have named one of your user-created sub-routines "toupper"--which is a really bad idea. Re: Toupper Programming Software Development by WaltP …"); } getch() return 0; } [/code] How would i implement the toupper code so i could change pick to upper case if… i have to # include anything at the top to use toupper?[/QUOTE] Q1) Do you know what %d does in your…] call? Q2) What does the documentation say about using [ICODE]toupper()[/ICODE]? Q3) Has anyone taught you how to format your… Toupper Programming Software Development by slygoth I need some help with the toupper code. [code] int main() { char pick; printf("A. Local …"); } getch() return 0; } [/code] How would i implement the toupper code so i could change pick to upper case if… i have to # include anything at the top to use toupper? Re: Toupper Programming Software Development by Arbus Hello slygoth, You should include ctype.h for using toupper. To convert lowercase letter to uppercase you should give [CODE]pick=toupper(pick); [/CODE] If the user enters 'a' you can convert it to 'A' using the above. toupper Programming Software Development by heo how can i make toupper global so that all variable in char will be all upper? Re: toupper Programming Software Development by ddanbe Do you mean the toupper function? toupper function Programming Software Development by zoner7 …to not affect his choice, so I am using the toupper() function. Unfortunately, when I try to return the value… an answer is all caps, avoiding the use of the toupper() function, everything turns out great. Here is my code.… (int i =0; i <=12; i++) { x[i] = x[toupper(i)]; } if (x == "EASY" ) { difficulty = 0; } if … toupper ASCII Programming Software Development by Emma_3 …;cctype> using std::cout; using std::cin; using std::toupper; char firstname[15], lastname[15]; int f = 0, l = 0… first name: " ; cin >> firstname; f = toupper (firstname[0]); l = toupper (lastname[0]); cout << "Welcome " <… Re: toupper ASCII Programming Software Development by Suzie999 …;cctype> using std::cout; using std::cin; using std::toupper; char firstname[15], lastname[15]; int main() { cout <<… name: " ; cin >> firstname; firstname[0] = toupper (firstname[0]); lastname[0] = toupper (lastname[0]); cout << "Welcome "… Re: toupper function Programming Software Development by Arpy Giri i believe your syntax is wrong here i is an integer and you are converting that integer into upper case which is absurd. the use of toupper function works differently [QUOTE] x[i]=toupper(x[i]); [/QUOTE] Re: toupper function Programming Software Development by Cybulski [code] #include <cctype> // for toupper() #include <algorithm> // for transform() transform(x.begin(), x.end(), x.begin(), toupper); [/code] try this Re: toupper and tolower for strings Programming Software Development by triumphost … comments.. you can use those instead of the ToUpper.. but I just used ToUpper instead of using the Ascii table. Does uppercase… short I = 0; I < Str.length(); I++) { Str[I] = toupper(Str[I]); } return Str; } string LowerCase(string Str) { /** for (unsigned… Re: toupper function Programming Software Development by selvaganapathy Hi I think [ICODE]x [i] = toupper (x[i]) ;[/ICODE] Re: toupper function Programming Software Development by selvaganapathy Hi I think [ICODE]x [i] = toupper (x[i]) ;[/ICODE] Also iterate to the length of the String. Not the fixed value. In the coding u specified 0 to 12. toupper and tolower implementation for whole c-strings Programming Software Development by tux4life This is a [B]toupper[/B] and [B]tolower[/B] implementation for whole c-strings, …without making use of the existing [B]toupper[/B] and [B]tolower[/B] functions for characters :) [U] example… Re: toupper and tolower implementation for whole c-strings Programming Software Development by tux4life Hi, naply, take a look at [URL=http://www.cplusplus.com/reference/clibrary/cctype/toupper/]this[/URL] and you'll see that [B]toupper[/B] only converts alphabet letters to uppercase (this is analog for [B]tolower[/B]), I intended my code to do 'exactly' the same :) WH>Am I good or what? Yes, you're the best :P Re: toupper method Programming Software Development by Narue …< s.size(); i++) s[i] = std::toupper((unsigned char)s[i]); [/code] You'll probably also … std::transform(s.begin(), s.end(), s.begin(), std::toupper); [/code] And variations of the corrected version: [code]… Upper { CharT operator()(CharT c) { return (CharT)std::toupper((unsigned char)c); } }; std::transform(s.begin(), s… Re: toupper and tolower implementation for whole c-strings Programming Software Development by William Hemsworth …*[/b] would have been used. Either way, using the [b]toupper[/b] function there outputs: RÚSUMÚ for me (even though… Re: toupper and tolower implementation for whole c-strings Programming Software Development by AuSsIeStOnE …<strlen(string); i++) if (islower(string[i])) string[i]=toupper(string[i]); toupper method Programming Software Development by clutchkiller Is there a way to use toUpper with a string, or do you have to loop it through an array of chars? Ive been googling everywhere, but havent really found any examples on how to properly use it. Thanks toupper() stopping when spaces are used Programming Software Development by hamby … (int i=0; i < sentance.size(); i++) {s[i] = toupper(sentance[i]);} return s; } Thanks for the help! Re: toupper() stopping when spaces are used Programming Software Development by Mr_Null_andVoid … (int i=0; i < sentance.size(); i++) { s[i] = toupper(sentance[i]); } return s; } int main(void) { string str("… toupper and tolower for strings Programming Software Development by FraidaL … i=0; while(i<s.length()) { s.at(i)=toupper(s.at(i)); i++; } cout << s <<… Re: toupper and tolower for strings Programming Software Development by nullptr You could also use - void TransformUppercase(std::string& s) { std::transform( s.begin(), s.end(), s.begin(), ((int(*)(int))std::toupper)); return; } Re: Toupper() Programming Software Development by nickx522 [CODE] //First input cout << setw(63) << "S for squareroot P for Power Q to Quit: "; cin >> LETTER; cout << "\n"; UPPER = toupper( 's' ); UPPER = toupper( 'p' ); UPPER = toupper( 'q' ); //If the input isnt Quit while (LETTER != 'Q')[/CODE] what am i doing wrong? Re: Toupper() Programming Software Development by thelamb No, toupper only takes one parameter. [code=cpp] char upChar = toupper( 'c' ); // upChar = 'C' [/code] Re: Toupper() Programming Software Development by nickx522 i need to write a code to do that?? i dont know exactly how to form it. all i know is that it has to include toupper. Re: Toupper() Programming Software Development by thelamb Did you google what the toupper function does? What parameters does it take etc. Re: Toupper() Programming Software Development by nickx522 yeah converts to upper case. ex char UPPER; char QUIZES = 'Q'; char TESTS = 'T'; UPPER = toupper( 'Q', 'T'); will this work? Re: Toupper() Programming Software Development by WaltP Use [I]toupper()[/I] on LETTER. That's your input.