Thursday, December 23, 2010

related to prev post

c++:
base *b=new base;
sub *s=new sub;
s ->base::foo(); // private instance variable of base has 0 or unknown value while executing foo() method of base class..

can't this be extended so as pass base class variable along with method call?
may be something like
s -> base{i=20,j=11}::foo();// here i and j were private variables of base..

can't this concept be useful in a programming language?

No comments:

Post a Comment