Help me in C++

Discussion in 'Mac Programming' started by sitha, Jul 24, 2006.

  1. macrumors newbie

    Jul 13, 2006
    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.

  2. macrumors 6502a

    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

Share This Page