Thread: please help!...find and replace

  1. #16
    Registered User
    Join Date
    Oct 2006
    Posts
    15
    where are those pages...i cant find them!

  2. #17
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    there's a website you may have heard of... begins with a g?
    anyway if you type stuff in there it finds it for you! in fact if you type strcpy or memcpy the very first link is what you want.
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  3. #18
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Either with your compiler (hint: mentioning it might be helpful) or online. Google can do wonders.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  4. #19
    Registered User
    Join Date
    Oct 2006
    Posts
    15
    ive been searching on google and i cant find anything to do with <cstring> in relation to find and replace. Im using putty

  5. #20
    Registered User
    Join Date
    Oct 2006
    Posts
    15
    sorry banshee

  6. #21
    Registered User
    Join Date
    Oct 2006
    Posts
    15
    but i have to do that from a file...

  7. #22
    Registered User
    Join Date
    Oct 2006
    Posts
    15
    Code:
    char str1[]="Sample string";
      char str2[40];
      char str3[40];
      strcpy (str2,str1);
      strcpy (str3,"copy successful");
      printf ("str1: %s\nstr2: %s\nstr3: %s\n",str1,str2,str3);
      return 0;
    how do i implement that to work so that it reads the 'find' from another file and replaces the word into another file, thus outputing to a new file?

  8. #23
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by amy589
    ive been searching on google and i cant find anything to do with <cstring> in relation to find and replace. Im using putty
    Don't search for the header, search for the aforementioned functions. To increase your odds, precede the function name by 'man'.

    Also,
    Quote Originally Posted by Dave_Sinkula
    Either with your compiler (hint: mentioning it might be helpful)
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  9. #24
    Registered User
    Join Date
    Oct 2006
    Posts
    15
    banshee.

    ive looked, how do i find from a file and replace to an outputted file.

  10. #25
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    >banshee.

    So banshee is your compiler. I'm not familiar with it.

    But I did do your assignment on input text with these three functions: strlen, strstr, and memmove.

    It turned this:
    You can be all that you can be in the army.
    into this:
    You can there all that you can there in the army.
    Is that what you are after?

    [edit]If so, learn to do this:
    http://www.google.com/search?q=man+strlen
    http://www.google.com/search?q=man+strstr
    http://www.google.com/search?q=man+memmove
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  11. #26
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Linux man...

    Why not the official Cppreference?
    http://www.cppreference.com/stdstring/index.html
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  12. #27
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by maxorator
    Linux man...

    Why not the official Cppreference?
    http://www.cppreference.com/stdstring/index.html
    I'd pretty much prefer the real official reference for C.
    JTC1/SC22/WG14 - C
    Grab n1124.pdf.

    Or maybe see if you can find a C++ draft here:
    JTC1/SC22/WG21 - The C++ Standards Committee

    Or maybe http://dinkumware.com/
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

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. Find and replace
    By BobDole1 in forum C++ Programming
    Replies: 1
    Last Post: 04-12-2003, 10:06 PM
  4. Find and Replace Text Function
    By mart_man00 in forum C Programming
    Replies: 45
    Last Post: 03-13-2003, 10:21 PM
  5. find and replace command?
    By p0wp0wpanda in forum C Programming
    Replies: 2
    Last Post: 05-24-2002, 11:42 PM