Name for array?

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <conio>

int main()
{
	int i, x[6], y[6] = {3, 8, 2, 9, 4, 1};
   	for(i=0; i<=5; i++)
   	   x[i] = y[i];
      for(i=0; i<=5; i++)
      	cout<<x[i];
   getch();
   return 0;
}


Hi, I study array inside C++ books...but don't really understand what the question ask...can anyone help? Thanks

1. What are the names of the arrays?
2. Which array is initialized during it declaration?
3. Which array is assigned values in a loop?

TQ...
Pretty basic. What are the arrays named. As in their identifier. When are they initizilized(assigned values)
Hi, sorry I don't get what's ur answer...I'm still a bigginer in this...hope can explain in details...
Give some sort of effort as to what you think to show you not just wanting asnwers:

1. very easy. Name of array is just like asking name of variable. name[arraySize].

2. wants to know which array is declarized, so if you know what arrays are and how their used. you will have the declared array ex: > name[3] < in this case would point to the 3rd element in the array size
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <conio>

int main()
{
    int i, x[6], y[6] = {3, 8, 2, 9, 4, 1};
    //     ^     ^    ^
    //     |     |    |
    //     |     |    -- Something is being initialized here (which array is it?)
    //     |     ------- An array is being defined here
    //     ------------- An array is being defined here
    //
    for(i=0; i<=5; i++)
        x[i] = y[i];
    //       ^
    //       |
    //       ----------- You are assigning values from one array to the other.
    for(i=0; i<=5; i++)
        cout<<x[i];
   getch();
   return 0;
}
Topic archived. No new replies allowed.