Initializing an array

If I've initialized an array, or let's say I'm trying to initialize an array, and I'd like to "cout" a portion of the array to make sure I've accomplished this. Shouldn't I be able to use a for loop to print out 10 elements and I should the 0 ten times? Assuming that my initialization character is 0.
Hmm you should do something that basically outputs from 0-9 (thats 10 dont forget that 0 is where a array starts) and use a loop to tick through it and should stop when it gets to 9

For example:

1
2
3
4
5
6
7
for(i=0; i < 10; ++i)

{

cout << arrayname[i];

}


sorry if this is wrong :( im a newbie trying to help out :P
Last edited on
That's wrong. You have a semi colon after the for statement. You don't need that.
sorry to go off topic but is it the right code to do what he wants?
Yes.
Thankyou

//End of topic//
Topic archived. No new replies allowed.