cp2 itself is a CppArray object, so when you implement the class functions, you have full access to all class members.
The definition of "private" is 'only the class itself can access the data'. Hence, cp2.s and cp2.value is fully accessible when you are inside a CppArray function.
cp2 itself is a CppArray object,
回覆刪除so when you implement the class functions,
you have full access to all class members.
The definition of "private" is 'only the class itself can access the data'. Hence, cp2.s and cp2.value is fully accessible when
you are inside a CppArray function.
Nice practice!
Your cousin.
Thanks a lot!
回覆刪除I've been training since entering NCTU, and just learned Data structure & Assembly language.
Little did I keep studying(reviewing may be better) the rest of C++, though class and template syntax are useful.
Now I have to face "virtual" and some special template using which I'm not familiar with.
The way to CS is hard...
Owen.