"Corno" <Corno@dds%FAKE%.nl> wrote in message
news:dm**********@azure.qinip.net...
Hi all,
is there a way to access a variable that is hidden by a new variable with
the same name in a nested block like this:
void doSomething()
{
int x = 5;
{
std::string x = doIntFunctionWithX(x);
}
}
you might wonder why I just don't rename the nested 'x'. Well, the code is
generated and it would be easy if I could keep the save variable name
('context' in my situation).
If the code is generated for you, then what kind of solution could we
possibly provide? Any solution would mean a code change, which you'd have
to to each time you re-generate the code, right? So the best solution would
be to rename one of those variables.
You might also check with whatever tool is generating that code. Is it from
some kind of diagram? Maybe you can change something in the diagram (or in
the tool settings) which will cause the tool to generate specific names
instead of the totally meaningless x (and other identifiers) shown here?
-Howard