Sat Nov 08, 2008 10:52 am
I'm having a class with lots of variables, and each one has a set get method.
Its actually not very important but I hate having too much names in a class.
For example i have a method that require a parameter var1, and the name var1
already used by the global variable. In java we can access both by using
this.var1 for global variable and var1 for local variable.
Is it possible to do the same in C++? How can I do it?
Sat Nov 08, 2008 10:53 am
This should be possible by using the scope resolution (::) operator to
access the global variable.
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.