is there a method to put back line after a getline(file, line), like putback(char)?
I mean, I want to read 2 times the same line.
first time to check if last char is punctual, second time to split line into tokens with myGetToken() that takes token of the file.
Not that I know of. But you don't need to do that anyway -- you used getline the first time, now you have the line as a string.
You can check if the last char is punctuation and split the line into tokens using that same string, without reading from the file twice.
If you really needed to go backwards in the file by some amount, you would use seekg after saving the previous location you were at. But again, you really shouldn't have to do this.
I still don't think you need to read any line from the file twice.
The logic that checking for punctuation operates on can use the same string that the logic for myGetToken operates on, if you structure it correctly.