how to skip the next line if condition c++
问题 I had a look in other examples but I can't make this one work. I have a file that at some point has weird characters for example : "Äèîpg" I don't want to save this line because it seems that the loop with getline will stop there (it stores until the line with the trash). How could I do it please? I know that when this occurs : "key =0", the next line will have these chars "Äèîpg". Here is my code: file = "example.log"; ifstream f(file); f.open(file); if (f.good()){ while (getline(f, line)) {