Initialization help- c programming

Declare an array named taxRates of 5 elements of type double and initialize the elements (starting with the first) to the values 0.10, 0.15, 0.21, 0.28, 0.31, respectively.

First attempt:
double[] taxRates = { 0.10 , 0.15 , 0.21 , 0.28 , 0.31 } ;

Second attempt:
double[5] taxRates = { 0.10 , 0.15 , 0.21 , 0.28 , 0.31 } ;
Last edited on
Partially correct, partially not. The [] or [5] are in the wrong place.
http://www.cplusplus.com/doc/tutorial/arrays/
Topic archived. No new replies allowed.