PDA

View Full Version : Help me in C++




sitha
Jul 24, 2006, 10:03 PM
Hi
I am writing a C++ program dealing with datas.
One of the function I used in my program as given below,

while (getline(input, buff)) {
if (buff.find("X-Coordinate") != string::npos) {
continue; // don't do anything else this pass through the loop
}

Now my problem is Once my program read a line with "X-Coordinate" it should pass 10 lines and then it should read datas from file. Pls help me how to get rid of 10 lines from a particular line.

Regards,
Sitha.



AlmostThere
Jul 25, 2006, 01:52 AM
Why not just read 10 lines and continue?

if (buff.find("X-Coordinate") != string::npos)
{
for(int i=0; i<10; ++i) { getline(input, buf); }
// Do other stuff
}