printing an array

I have what is probably a very simple question.
How do I print out an array as a whole? What I mean is that I have 8 inputs and I want to print out all 8 together at the end of the while loop?

Here is what I got.

int r0 = 0; //value select pin at the 4051 (s0)
int r1 = 0; //value select pin at the 4051 (s1)
int r2 = 0; //value select pin at the 4051 (s2)
int row = 0; // storeing the bin code
int count = 0; // just a count
int bin = {000, 001, 10, 11, 100, 101, 110, 111};

int a1=0;
int b2=0;
int c3=0;
int d4=0;
int e5=0;
int f6=0;
int g7=0;
int h8=0;

int anaR = {a1, b2, c3, d4, e5, f6, g7, h8}; //read inputs
int anaSave = {a1, b2, c3, d4, e5, f6, g7, h8}; //store input

void setup()
{
pinMode(0, INPUT);
pinMode(22, OUTPUT); // s0
pinMode(23, OUTPUT); // s1
pinMode(24, OUTPUT); // s2

Serial.begin (9600);
}

void loop ()
{
while (count <8 )
{
row = bin[count];
r0 = row & 0x01;
r1 = (row>>1) & 0x01;
r2 = (row>>2) & 0x01;
digitalWrite(22, r0);
digitalWrite(23, r1);
digitalWrite(24, r2);
anaSave[count] =analogRead(anaR[count]);
Serial.print("Here it comes ");
Serial.println(anaSave[count]);
delay (1000);
count++;
}
Serial.print("One output of all inputs is ");
Serial.println(anaSave[a1, b2, c3, d4, e5, f6, g7, h8]); // array output of all inputs together
count=0;

}

Thanks

An array is a collection of like instances. There is no built in support for printing an array. You need to use a for loop to print each element of the array.

Obviously this part is not doing what I want: Serial.println(anaSave[a1, b2, c3, d4, e5, f6, g7, h8]); // array output of all inputs together

The only way I know of get the display to print out a single line with everything is this:

Serial.print(anaSave[0]); Serial.print(anaSave[1]); Serial.print(anaSave[2]); Serial.print(anaSave[3]); Serial.print(anaSave[4]); Serial.print(anaSave[5]); Serial.print(anaSave[6]); Serial.println(anaSave[7]);

Is there a better cleaner way to print out everything with a single statement? Thanks

Not a single statement, but as PaulS said, a for loop.

i.e.

for (int x=0; x<8; x=x+1){
Serial.print(anaSave[x]);
}
Serial.println""; // force 'carriage return' at the end
Serial.println"";

??

Sorry, I did change it to a for loop before I made my last post.
This is how it looks:
void loop ()
{
for (count =0; count <=7; count++)
{
row = bin[count];
r0 = row & 0x01;
r1 = (row>>1) & 0x01;
r2 = (row>>2) & 0x01;
digitalWrite(22, r0);
digitalWrite(23, r1);
digitalWrite(24, r2);
anaSave[count] =analogRead(anaR[count]);
Serial.print("Here it comes ");
Serial.println(anaSave[count]);
delay (1000);
}
Serial.print("there ");
Serial.print(anaSave[0]);
Serial.print(anaSave[1]);
Serial.print(anaSave[2]);
Serial.print(anaSave[3]);
Serial.print(anaSave[4]);
Serial.print(anaSave[5]);
Serial.print(anaSave[6]);
Serial.println(anaSave[7]);
}

The way I understand what PaulS is saying is that I will have the “Serial.println” inside the for loop. I already have that and it only returns one statement at a time.
Everything gets stored correctly as I can call each component of the “anaSave” individually and get the answer “Serial.print(anaSave)”. I am looking for a statement that when watching in the serial monitor it will show one line and in that line all 8 saved inputs will be displayed. Something that is shorter than writing 7 separate line.

You are populating the array in a for loop. Can you not see that you can print the array in a for loop, too?

for(count = 0; count <= 7; count++)
{
   Serial.print(anaSave[count]);
}
Serial.println(); // Output the carriage return/line feed

I was close! Serial.println""; just missing the ( ) s.