Thread: Can you help me about tolower() in file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User GL.Sam's Avatar
    Join Date
    Aug 2009
    Posts
    88
    I don't quite understand what help do you need. tolower() is a standard function from <ctype.h> header. If you want to apply it to an arbitrary string you could do something like:
    Code:
    void lower_string(char *str)
    {
      while (*str)
      {
        *str = tolower(*str);
        ++str;
      }
    }
    Last edited by GL.Sam; 05-12-2010 at 06:56 AM.
    The only good is knowledge and the only evil is ignorance.
    ~Socrates

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    5
    Thank you dear GL.Sam. You re right . I must write example code.

    In my menu
    at
    case 1 : tolower ()
    case 2 : delete_line()

    Code:
    case 1 :
                            
    tolower();/* at these , i want to  all words lowercase in a file*/
    break ;
    
    case 2 :
    
    delete_line() ;  /* delete line*/
    break ;
    "delete_line()" function is written by me and working perfect at "case 2" . But i want to call "tolower()" function at "case 1" for all words to lowercase in file (for example ; simple.txt) .

    How can i succes this ? Thank you .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  2. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  3. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM