Thread: Need help capitalizing characters in a strong

  1. #16
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    If you haven't worked with pointers, just use the array you have. The reason I asked how you knew you were at a new word, is because I wanted you to think about how YOU know you are at a new word in a sentence.


    Code:
    lastletter = space
    for each letter in the string
        if this is not a letter and last is a space
            caps this letter
        else
            last letter = this letter
    Quzah.
    Hope is the first step on the road to disappointment.

  2. #17
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by zbred View Post
    Honestly, I don't know how to make the pointer ucp work.
    Gees... look at the function I wrote... it's right there.

    Look up the behavior of strchr() ... that's what makes it work.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Replies: 2
    Last Post: 09-16-2009, 06:00 AM
  3. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  4. How do you check how many characters a user has entered?
    By engstudent363 in forum C Programming
    Replies: 5
    Last Post: 04-08-2008, 06:05 AM
  5. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM