I have a class whose Default Constructor is giving me issues. I am trying to make it so that, when the class object is instantiated, it will have only an array of four doubles set to 0, 0, 0, 0. How do I go about doing this? I have, so far...
The first curly brace in the default constructor in the .cpp file says that it "expects an expression." Does this mean I have to give the array a set size? If so, where?
Have you tried using the constructor's initializer list? By the time you reach line 7 in your first example the array has already been created and initialized.
You may want to note that regardless of that, your attempts to assign to an array on line 7 of the first and 9 of the second examples aren't valid syntax; in the first you can't assign to a non-index element of an array and in the second you are not only trying to assign to an element 1 unit past the end of the array but also trying to assign a list to it.
I hadn't realized/didn't know that quarterSales[]={0, 0, 0, 0}; and array[SIZE] = {0, 0, 0, 0}; were improper syntax. How disheartening. Anywho, this is what I've come up with knowing that fact. No errors (as far as the compiler tells me).