Thread: function to find and replace a part of a string

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    9

    function to find and replace a part of a string

    I deleted my post because I came to realise it was a stupid question
    Last edited by 9988776655; 01-03-2008 at 03:15 PM.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I don't think you need the second getchar() in your function, as fgets() actually removes the newline from the input buffer, so there should be no newline in the input buffer to "kill".

    So what do you want to do once you have found the string to replace?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    2
    Be Positive

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to find and replace a string in a file
    By salzouby in forum C Programming
    Replies: 13
    Last Post: 09-14-2010, 08:55 AM
  2. Find and replace within a string?
    By clancyPC in forum C Programming
    Replies: 3
    Last Post: 03-20-2009, 07:28 AM
  3. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 09:10 AM
  4. Replies: 5
    Last Post: 05-25-2004, 04:36 PM
  5. Find and Replace Text Function
    By mart_man00 in forum C Programming
    Replies: 45
    Last Post: 03-13-2003, 10:21 PM