How to print??

Okay so I am trying to print four words and four numbers every line. Since there are conditions attached to the print statement, I have no idea how to print.

Now: michigan 0 alabama 0 hawaii 2 newyork 12........
What I wanted: michigan 0 alabama 0 hawaii 2 newyork 12
michigan 0 alabama 0 hawaii 2 newyork 12

1
2
3
4
5
6
7
8
9
10
11
  for(i=0;i<65;i++)
    {
        if(HashinString[i]!="EMPTY")
        {
            cout<<HashinString[i]<<" "<<hValue[i]<<" ";
        }
        else
        {
            cout<<"EMPTY 0"<<" ";
        }
    }

Thanks for any help
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int counter = 0;
for(i=0; i < 65; i++)
{
    if(HashinString[i]!="EMPTY")
    {
        cout<<HashinString[i]<<" "<< hValue[i]<<" ";
        counter++;
    }

    if (~counter & 3)
    {
        cout << endl;
        counter = 0;
    }
}
Topic archived. No new replies allowed.