answersLogoWhite

0

void to_uppercase (char* str) {

if (str == 0) return;

while (*str != '\0') {

if (*str>='a' && *str<='z') *str-=32;

++str;

}

}

User Avatar

Wiki User

7y ago

What else can I help you with?

Related Questions

Java program to convert lowercase to uppercase?

You can use the toUpperCase() method on a String to convert any String to all uppercase.


Is uppercase ever used in a C program?

Yes. By convention, macros use all uppercase while all user-defined names should have a leading capital to differentiate them from standard library names which are all lowercase.


What is uppercase in computer?

For example, box is in lowercase while BOX is in uppercase. The term is a vestige of the days when typesetters kept capital letters in a box above the lowercase letters. A program that distinguishes between uppercase and lowercase is said to be case sensitive.


Write a program to initialize a character and print whether it is uppercase lowercase or special character in java module 1?

I'll just write a function to do that, I hope the good people won't try to run it as it is.... void function() { char c = 'a'; if( c &gt;= 'a' &amp;&amp; c &lt;='z' ) System.out.println("LowerCase"); else if( c&gt;='A' &amp;&amp; c &lt;='Z' ) System.out.println("UpperCase"); else System.out.println("Special Character"); }


What setting on a computer or program might affect the sort order of electronic records?

There is a "Sort Option" in Word and Excel that would allow the program to sort by "Case sensitive" (UPPERCASE versus lowercase) criteria. Access ignores the "case" when sorting.


Many languages distinguish between uppercase and lowecase letters in user-defined names what are the pros and cons of this design decision?

In computer programming, many languages distinguish between uppercase and lowercase letters in user defined variables. This is an advantage because it allows users to tell the difference between variables based on whether they are uppercase or not. It is a disadvantage because forgetting to change a letter to the proper case will result in an error when the program runs.


How do you write a C program to input a string of lowercase alphabets and convert it to uppercase?

Here is program code written in plain C:#include #include void upString(char *str);int main() {char str[100];printf("Enter string: ");gets(str);upString(str);printf("UpperCase version: %s\n", str);return 0;}void upString(char *str) {register int ind = 0;while (str[ind]) {str[ind] = toupper(str[ind]);ind++;}}Testing:Enter string: Testing this application, to see if it works.UpperCase version: TESTING THIS APPLICATION, TO SEE IF IT WORKS.Note:You should not be using gets() function in real-world application. There is no way you can limit number of characters to read thus allowing to overflow buffer. It was used only for example.


Write a program convert a string from uppercase to lower case and vice-versa without using string tolower and string toupper commands in TCL?

[ string toupper $str ] or [ string tolower $str ]


Write a program to generate uppercase using cSharp?

string s = "asdfqwer"; s = s.ToUpper(System.Globalization.CultureInfo.CurrentCulture);


Write a program using a loop to output all the letters of the alphabet in uppercase?

Here's the code for your program: # Loop through the uppercase alphabet letters for letter in range(ord('A'), ord('Z') + 1): print(chr(letter)) BTW you can use this code in Python and try it out for yourself.


Differentiate keywords and identifiers in C programming?

keywords:- every word in a c program is either a keyword or an identifier. All keywords are basically the sequences of characters that have one or fixed meanings. And these meanings in any circumtances , can't be changed. All c keywords must be written in lowercase (small) letters. eg:- auto, break ,case, char, const, do, if ,double, else .....etc identifiers:- identifiers r names given to program elements such as variables , arrays &amp; functions. Basically identifers r the sequences of alphabets or digits. Rules for forming identifier name * the first character must be analphabet (uppercase or lowercase) or an underscore * all succeeding characters must be letters or digits. * no special characters or punctuatio symbols are allowed except the underscore"_". * no two successive underscores are allowed. * keywords shouln't be used as identifiers.


Write program using c programig to convert uppercase to lower case?

#include &lt;stdio.h&gt; int main() { int n; char ch; scanf("%d", &amp;n); { scanf("%c", &amp;ch); ch-=32; } printf("%c", ch); return 0; }