Why does my assertion fail?
If I implemented it correctly the line " vector y(2);" in main should initialize an object of the class vector.
The constructor sets n = 2, because I used the parameter "2".
And that should also set y.n = 2.
Hey ats15, thanks for the help! Now it works for me too.
To be more specific:
I wanted to access the first element of the vector y, which is y[0], via "y[0]=2"
Just to get this straight, is it possible to write in y[0] with saying y[0]=2 (at this stage of the code it is not). But can i tweak something to make it look like this? And not like this *(y[0]) = 2
If not, I'm completely fine with that. I just want to know all possible ways for my program to work.