upper case to lower case problem

This is a discussion on upper case to lower case problem within the C++ Programming forums, part of the General Programming Boards category; i have a char *stname = new char[41]; which is in upper case, how can i turn it to lowercase ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    upper case to lower case problem

    i have a char *stname = new char[41];

    which is in upper case, how can i turn it to lowercase with a method different from the FAQ?

    i have tried the method provided in the FAQ but failed....please help

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    i have changed the porgram to.....

    thank you for helping.
    heres the code, which is worked:
    [code]
    #include<cctype>
    #include<iostream.h>

    int main()
    {
    char stname[] = "YU CHAU STREET";

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    sorry........the code is......

    thank you for helping.
    heres the code, which is worked:

    Code:
    #include<cctype>
    #include<iostream.h>
    
    int main()
    {
    char stname[] = "YU CHAU STREET";
    for(char *letter = stname1;*letter !='\0'; ++letter)
    {
          *letter = tolower(*letter);
    }
    cout << stname1;
    return 0;
    }
    but if i have defined stname1 as follow:
    Code:
    char *stname1 = new char[41];
    how should i change the code so that it will work too?
    once again thank you....

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    really thank you sooo much

    it works.....
    really thank you ~~

    i learn something new everytime i come here~~~
    what a great place here~~~~

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ascii rpg help
    By aaron11193 in forum C Programming
    Replies: 18
    Last Post: 10-29-2006, 01:45 AM
  2. Replies: 27
    Last Post: 10-11-2006, 04:27 AM
  3. Base converter libary
    By cdonlan in forum C++ Programming
    Replies: 22
    Last Post: 05-15-2005, 01:11 AM
  4. Big Problem With Passing an Matrix to Main Function
    By Maragato in forum C Programming
    Replies: 4
    Last Post: 06-14-2004, 11:06 PM
  5. rand()
    By serious in forum C Programming
    Replies: 8
    Last Post: 02-15-2002, 01:07 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21