array help

Hello guys, I need to create an array of variables holding initial parameters. When i try to compile the full code, i'm getting an error saying 'inital' was not declared in the scope.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
inital[0] = V_H;
inital[1] = V_L;
inital[2] = gamma_H;
inital[3] = gama_L;
inital[4] = alpha_coef;
inital[5] = beta_coef;
inital[6] = V_alpha;
inital[7] = V_beta;
inital[8] = V_H2;
inital[9] = V_L2;
inital[10] = gamma_H2;
inital[11] = gamma_L2;
inital[12] = alpha_coef2;
inital[13] = beta_coef2;
inital[14] = V_alpha2;
inital[15] = V_beta2;
how is initial declared?
like rich says, you need to declare initial before you can populate it.

looking at the data i presume they are doubles.

double initial[16];
hello guys ,
please tell me the basic method of creating array because i am new in c++
and tell me what is the method of becoming a good programmer?
closed account (j3Rz8vqX)
@bcs96: You should create your own thread.

The thread was solved already by Jaybob66.

Fusion of two codes: (Provided by dev1903 and Jaybob66)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//Initializing the array:
double initial[16];

//Populating the array:
inital[0] = V_H;
inital[1] = V_L;
inital[2] = gamma_H;
inital[3] = gama_L;
inital[4] = alpha_coef;
inital[5] = beta_coef;
inital[6] = V_alpha;
inital[7] = V_beta;
inital[8] = V_H2;
inital[9] = V_L2;
inital[10] = gamma_H2;
inital[11] = gamma_L2;
inital[12] = alpha_coef2;
inital[13] = beta_coef2;
inital[14] = V_alpha2;
inital[15] = V_beta2;


To initialization an array, you would call it with its maximum size or with a dynamic size with included elements.
http://www.cplusplus.com/doc/tutorial/arrays/

As for
method of becoming a good programmer?
I'm sure a lot of folks can give you tips in the Lounge forum - Post that in the Lounge forums, people can help you there.
Topic archived. No new replies allowed.