Thread: Counting occurances of two letters in a particular order?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Every time you find an 's', (which has been preceded by an i), you need to reset a variable.
    Last edited by Adak; 09-27-2010 at 11:42 PM.

  2. #2
    Registered User Char*Pntr's Avatar
    Join Date
    Sep 2007
    Location
    Lathrop, CA
    Posts
    198
    Quote Originally Posted by Adak View Post
    Every time you find an 's', you need to reset a variable.
    like this:

    Code:
    			is_s_count = FALSE;
    		}
    
    		is_s_count = FALSE;
    my god, I never thought this thread would last this long. Probably never broke out
    the pen & paper like I originally suggested.

    And I still don't see that 3rd if() to test if both are "i" and "s" were set. I have the
    working solution for this, but I require some thought and effort by the OP.

    Adak, can I IM you my code? I tested it and it seems to work fine. I'm not sure if it meets
    the "state machine" implementation, that may/may not be required.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Warnings about initializer order
    By CodeMonkey in forum C++ Programming
    Replies: 5
    Last Post: 06-18-2009, 07:55 PM
  2. Switching letters
    By XiReDDeViLiX in forum Windows Programming
    Replies: 4
    Last Post: 06-06-2002, 06:48 AM
  3. Character counting program
    By TankCDR in forum C++ Programming
    Replies: 5
    Last Post: 04-05-2002, 10:01 PM
  4. Counting letters in window
    By Soldier in forum C++ Programming
    Replies: 3
    Last Post: 03-29-2002, 11:34 PM
  5. Replies: 1
    Last Post: 01-06-2002, 06:28 PM