Scope resolution operator

S

Shan

In the following code:

func()
{
int SmeVar;
{
int SmeVar;
//Here I want to use SmeVar defined in the outer block how
can I do that ?
}
}
 
J

Jerry Coffin

(e-mail address removed)>, (e-mail address removed)
says...
In the following code:

func()
{
int SmeVar;
{
int SmeVar;
//Here I want to use SmeVar defined in the outer block how
can I do that ?
}
}

It's not possible unless the namespace in which SmeVar is located has a
name, which it doesn't in this case.
 
S

Stefan Naewe

Hi,
Thanks for the reply, can you suggest any way of doing this using
scope resolution operator?

No.
Read what Jerry said. You need a named scope.

S.
 
J

Jim Langston

Shan said:
Hi,
Thanks for the reply, can you suggest any way of doing this using
scope resolution operator?

Sure. Give one of the variables a different name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top