Count the letters of a string.

This is a discussion on Count the letters of a string. within the C++ Programming forums, part of the General Programming Boards category; How do you check a line of text using the cin.getline function and count the occurences of each letter of ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    9

    Count the letters of a string.

    How do you check a line of text using the cin.getline function and count the occurences of each letter of the alphabet.

    thanks for your help

  2. #2
    Registered User Engineer's Avatar
    Join Date
    Oct 2001
    Posts
    125

    Red face

    After you got the string you want to check ( doesn't matter what you were using to get it), you can check it char by char from the start of the string to the end and count every time you run into the char you are looking for.
    1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please check my C++
    By csonx_p in forum C++ Programming
    Replies: 263
    Last Post: 07-24-2008, 09:20 AM
  2. Replies: 26
    Last Post: 11-30-2007, 02:51 AM
  3. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  4. problems with overloaded '+' again
    By Brain Cell in forum C++ Programming
    Replies: 9
    Last Post: 04-14-2005, 05:13 PM
  5. lvp string...
    By Magma in forum C++ Programming
    Replies: 4
    Last Post: 02-26-2003, 11:03 PM

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