i want to make an output that is going to be 18 down and 3 across. i have a structure made with 3 elements. how do i go about with a for loop to output the 3 columns. like a data table
thanks

Code:
	int x,x2;
	while(infile)
	{
		for(x=0; x<18; x++)
		{
			infile>>array[x].code>>array[x].income>>array[x].members;
		}
	}
	cout<<"ID Code		Income		Members"<<endl;
	cout<<"_________________________________"<<endl;

	for(x=0;x<18;x++)
	{
		cout<<array[x].code<<"		";