sccheung
asked on
Beginner's Question: with statement in C++
I recently migrate from Pascal. But I can't find anything like the Pascal "with" statement in the C++ online help. How to do this in C++?
What was the "with " statement doing?...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yeah, there really is no equivalent, which is actually good. Pascal's with statement was a mistake that leads to confussion an problems. This one of the rare times when C++ has a syntractic advantage of Pascal
In a sense, C++'s member functions are similar to Pascal's "with". This is because a member fucntion can access all the data members of an object (class or structure) without having to explicitly dereference the "this" pointer to get to the data members.
In a sense, C++'s member functions are similar to Pascal's "with". This is because a member fucntion can access all the data members of an object (class or structure) without having to explicitly dereference the "this" pointer to get to the data members.
ASKER
It's fine. I can use copy and paste instead. But since the answer didn't "solve" the question, (because there is no solution in this case) I can't give a very high grade.