I just wanted to know if these are appropriate declarations

digits is an array of 10 integers = int digits [10]

rates is an array of 6 floats = float rates [10]

Printable View

- 12-17-2005sashax415Declaring Variables for Arrays~ Newbie Question
I just wanted to know if these are appropriate declarations

digits is an array of 10 integers = int digits [10]

rates is an array of 6 floats = float rates [10] - 12-17-2005Salem
digits is good, rates isn't.

- 12-17-2005EnahsCode:
`int digits[10];`

double rates[6];

And that start indexing at 0.

So you have digits[0] through digits[9].

Code:`//declared earlier`

digits[0] = 555; //First value in array gets 555

digits[9] = 323; //Last value in array gets 323

rates[4] = 99.99; // 5th value in rates array gets 99.99