I'm having a small problem with the getline function, i can't think of a command that will do this:
Let's suppose i have a basic code that takes data from a file 'file1' and outputs it into a file file2.
now what i want to happen is, let's say the sentence in file1 (or the input) is:
hello i am testing 1
but the integer 1 can be any random integer.
what im trying to do is to get the getline function to stop at 1 (but i dont want to say getline(ind,sentence,'1'), but instead of "1" i want it to accept any integer. I don't know if i made myself very clear, but is that feasible?
An easier way to do this I think would be using ifstream.peek(), "if(...)" check and the ">>" operator. You would be reading the data as delimited by white space but that shouldn't make a difference from what I see in your code. Also in order to do this you would need to read the data in with a loop.