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.

Create a function called isdelim(char c) that tests c for one of the delimiters.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.