0

Hello

I'm trying to figure how can I just a while or what statement to either stop at the next delimiters or stop at the end of the line. here's my code:

while( getline(i_file, arrayl, ';')){
        cout<<"check 1"<<endl;

        istringstream iss(arrayl);

        iss>>array;

        cout<<array<<"<~~~~~~~~~~~array!"<<endl;


        int num [array];



        int i = 0;


        while(getline(i_file,arrayl, ',')){
            if(i==array)
                break;
            istringstream iss(arrayl);
            iss>>num[i];
            cout<<num[i];
            cout<<"check 2 i="<<i<<endl;
            i++;

by the way There's two delimitors one for the array and one for the numbers that go into the array. I need to know how can I stop at the end of the line or the next delimiter ';'. btw I have some error checking code as well.

Edited by rugged1529: n/a

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by WaltP
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.