Thread: String Manipulation C

  1. #1
    Registered User
    Join Date
    Jan 2006

    String Manipulation C

    Hi all,

    i have the following string as input :

    "<iframe src=";wi.120;hi.600/01?page=" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" allowtransparency="true" width="120" height="600">
    <script language="JavaScript" type="text/javascript">
    document.write('&lt;a href=";wi.120;hi.600/01/" target="_blank"&gt;&lt;img src=";wi.120;hi.600/01/"/&gt;&lt;/a&gt;');
    </script><noscript><a href=";wi.120;hi.600/01/" target="_blank"><img border="0" src=";wi.120;hi.600/01/" /></a></noscript></iframe>"

    also some more lenghty strings i need to write then into files.

    for that i need to reaplce " to \" in this string .

    please help me how can i replace so using a C program.

    thanks in advance,

    Trinath somanchi,

  2. #2
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Post your best attempt so we can help you out.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  3. #3
    Registered User
    Join Date
    Mar 2004
    You can use a pointer to step along each character in the string, and then compare what the pointer is pointing at with ' " '.

  4. #4
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Cambridge, UK
    well, read a single line from the file search for rright place to replace using str or strstr(these fucntion used to find the place to insert) and then insert the replace string


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  2. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  3. Replies: 4
    Last Post: 03-03-2006, 02:11 AM
  4. Linked List Help
    By CJ7Mudrover in forum C Programming
    Replies: 9
    Last Post: 03-10-2004, 10:33 PM
  5. string manipulation
    By SPEKTRUM in forum Linux Programming
    Replies: 3
    Last Post: 01-26-2002, 11:41 AM