Thread: string manipulation

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    1

    string manipulation

    Develop a C program that prompts its
    user for a word that contains the sequence of
    letters "reat" (for example, the user could
    type in the word: great, treat, threat,
    greatly or treatise), replaces that letter
    sequence by "r8" and prints the result to the
    screen. For the 5 example words given earlier,
    the result printed by the program should be:
    gr8, tr8, thr8, gr8ly and tr8ise, respectively.
    Test your program and then paste it below
    (note 1: you may want to start with great and
    threat, and then enhance your code to also
    work with greatly and treatise).
    (note 2: this question is about string mani-
    pulation and does NOT involve conditionals
    or iteration statements).

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657

  3. #3
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    You also might want to start - after taking into account the prior post - by posting this on the C forum, not the C++ forum.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need help with string manipulation.
    By newbc in forum C Programming
    Replies: 5
    Last Post: 02-08-2011, 04:36 PM
  2. string vector to string pointer manipulation
    By stanlvw in forum C++ Programming
    Replies: 11
    Last Post: 07-16-2008, 01:43 AM
  3. string manipulation
    By stanlvw in forum C++ Programming
    Replies: 8
    Last Post: 07-10-2008, 10:18 AM
  4. A little help with string manipulation
    By InvertedSaint in forum C Programming
    Replies: 17
    Last Post: 11-05-2005, 09:14 AM
  5. string manipulation, the best way?
    By shoobsie in forum C Programming
    Replies: 8
    Last Post: 06-30-2005, 01:19 AM

Tags for this Thread