Hi, and thanks for any help you can offer in advance! I'm very new to C++ and coding in general, and I'm having trouble figuring out what is wrong with this program. I'm trying to replace all occurrences of the string #N# in an input file with the first and last name entered by the user. I'm terrible with loops, so that's probably the issue I just can't tell what. The output just gives me the first and last name over and over, it never writes the other characters to the output:
**EDIT: I realized that I should have used == instead of = in the if statements, and that fixed it. But I'm wondering how I can check to see if its the first occurrence of #N#, because I'd like to have only the first name for the following occurrences. **