This is what I have thus far. I'm leaving the input file alone and trying to replace "#N#" with a new string name and outputting it to a new file. My compiler is telling me .get can only be used for chars and not strings. So how would I get it to read a string then replace it with another string? Thanks.
Note that like cin, this will extract up to a whitespace character, so if you have, for example "Hello World", only "Hello" will be extracted. If you want to extract the whole line "Hello World", use std::getline(). http://www.cplusplus.com/reference/string/string/getline/
I used integralfx's suggestion. It works for the first case, but the 2 other "#N#" stay the same.
Also, all the spaces disappear and everything is pushed onto one line.
Did you solved your issue? Just because I was wondering if your line number 43 in_stream.get(place); //reading a string
shouldn't stay inside the while-loop, like:
1 2 3
while(! in_stream.eof()){
in_stream.get(place); //reading a string
if(place == "#N#")
The problem is it doesn't make any sense, since you pass the string "name" and then you ask for the name inside the function - the two methods clash each other, I think.