Question: If I have an array of doubles, such as `static double arr[10];` and I'd like to initialize all of the values in the array to `0`, I do:

```
1 for (int i = 0; i < 10; i++)
2    arr[i] = 0;

```

**My question:**

Is line 2 correct, or do I need to initialize to `0.0`? What's the difference?

Answer: 
Yes. `arr[i] = 0;` is correct. `0` will be implicitly converted to `double` type.
Your line 2 is correct. `0` will be implicitly converted to `double`.

Btw you have declared `arr` static so all elements will be initialized to `0` automatically anyway. No need for the loop.

Additionally, if you want to initialize all elements of a non-static array to `0`, you can just do this:

```
double arr[10] = { 0.0 };

```