Link to home
Start Free TrialLog in
Avatar of sccheung
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++?
Avatar of David MacDonald
David MacDonald
Flag of Canada image

What was the "with " statement doing?...
ASKER CERTIFIED SOLUTION
Avatar of AlexVirochovsky
AlexVirochovsky

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nietod
nietod

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.
Avatar of sccheung

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.