Search:

Type: Posts; User: Norm

Search: Search took 0.14 seconds.

  1. Replies
    20
    Views
    1,063

    [SOLVED] Re: to replace a word in file

    What file I/O class has a replace() method?

    If the program deletes the file BEFORE calling the declare() method, then appending to a new file would work.
  2. Replies
    20
    Views
    1,063

    [SOLVED] Re: to replace a word in file

    I guess there are things done in other parts of the program that have not been explained. The posted code appends what it writes to the file. It does not replace the contents of the file.
  3. Replies
    20
    Views
    1,063

    [SOLVED] Re: to replace a word in file

    What is in the file if you execute the program more than one time?
  4. Replies
    20
    Views
    1,063

    [SOLVED] Re: to replace a word in file

    What's in s and what is in newTxt?

    If s is all of the old file's contents and newTxt is "int"
    how does writing those two values one after the other solve your problem?
  5. Replies
    20
    Views
    1,063

    [SOLVED] Re: to replace a word in file

    What about my second and third questions?
  6. Replies
    20
    Views
    1,063

    [SOLVED] Re: to replace a word in file

    I don't think the posted code does anything like what you want:
    Where does the currently posted code read the contents of the file?
    Where does the posted code change anything that could have been...
  7. Replies
    20
    Views
    1,063

    [SOLVED] Re: to replace a word in file

    What happens when the posted code is executed? Can you post something that shows what it does and add some explanations that say what is wrong and show what you want the output to be.
Results 1 to 7 of 7