Why normal constructor won’t do the job and we will need constructor initializer?
Consider the code on the right side of this page currently it does compile without any errors but What if we uncomment the constructor which is currently commented and comment the following instead : //Chart (int & i) : m_xVal{i} {} Chart (int i){m_xVal = i;} Lets compile it to see the following error: #include …
Why normal constructor won’t do the job and we will need constructor initializer? Read More »