Dynamic Array
value-initialize
In dynamic array, it could only initial w/ default value, not like static array, could initial as different values.
int *pia = new int[10](); // 10 ints w/ default value 0
const int ival = 1024;
const int &refVal = ival;
const int &r = 42;
const int &r2 = r + 3;
for (vector<string>::const_iterator iter = text.begin();
iter != text.end(); ++iter) {
*iter = " "; // error: *iter is const
}
vector<int> nums(10);
const vector<int>::iterator cit = nums.begin();
*cit = 1; // OK
++cit; // error: cit is const
const double pi = 3.14;
double *ptr = π // error: nonconst pointer
const double *cptr = π // OK
double dval = 2.99;
cptr = &dval; // OK
int errNumber = 0;
int *const curErr = &errNumber;
curErr = curErr; // error: curErr is const
if (*curErr) {
errorHandler();
*curErr = 0; // OK
}
const double pi = 3.14159;
const double *const pi_ptr = π
pi_ptr is a constant pointer, point to a const double object.typedef string *pstring;
const pstring cstr;
Q: What is cstr? ii -> V -> I
, I -> IV
等慣用進行Tonic -> Sub-dominant -> Dominant -> Tonic
的感覺考慮進去Tonic -> Sub-dominant
or Tonic -> Dominant
(but it’s more comfortable to use Tonic -> Sub-dominant -> Tonic
) (1)Sub-dominant -> Tonic
or Sub-dominant -> Dominant
(2)Dominant -> Tonic
(3)7-2-#4
and Bm7 is 7-2-#4-6
.