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,348
    Manasij Mukherjee | gcc-4.8.0 @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,672
    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.
    I used to be an adventurer like you... then I took an arrow to the knee.

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, 03: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, 08: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


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