Like Tree1Likes
  • 1 Post By hk_mp5kpdw

string manipulation

This is a discussion on string manipulation within the C++ Programming forums, part of the General Programming Boards category; Develop a C program that prompts its user for a word that contains the sequence of letters "reat" (for example, ...

  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
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,504
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  3. #3
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,806
    You also might want to start - after taking into account the prior post - by posting this on the C forum, not the C++ forum.
    Elysia likes this.
    "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, 02:43 AM
  3. string manipulation
    By stanlvw in forum C++ Programming
    Replies: 8
    Last Post: 07-10-2008, 11: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, 02:19 AM

Tags for this Thread


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