unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > Programming > C and C++

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2007, 12:15 PM
Neo_Reloaded Neo_Reloaded is offline
Tutorial Admin
 
Join Date: Dec 2006
Posts: 259
Default (C) Convert string to all lower case

By Chernobyl

Here is a little program i wrote (its actually the first Exercise of my college homework lol), what it does is it takes a string from the user and converts all upper case letters to lower case

Code:
/*
    Exercise 1
    By Stephen V (Chernobyl)
    WwW.Console-World.Org
*/

#include <stdio.h>
#include <ctype.h>
#include <string.h>

void main()
{
    char str[50];
    short int x = 0;

    printf("Please enter a string: ");
    gets(str);

    while(str[x] != '\0')
    {
        if(isupper(str[x]))
            printf("%c", tolower(str[x]));
        else
            printf("%c", str[x]);

        x++;
    }

    printf("\n\nPress ENTER to continue!");
    getchar();
}
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
case, convert, lower, string

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 09:54 AM.