V
Vipul Jain
Can any one please tell me what is the difference between global
scope of an variable and file scope of an variable.
Vipul
scope of an variable and file scope of an variable.
Vipul
Vipul Jain said:Can any one please tell me what is the difference between global
scope of an variable and file scope of an variable.
Vipul said:Can any one please tell me what is the difference
between global scope and file scope of an variable.
int a = 0; // global scopecat file.cc
E. Robert Tisdale said:int a = 0; // global scope
static
int b = 0; // file scope
Can any one please tell me what is the difference
between global scope and file scope of an variable.
int a = 0; // global scopecat file.cc
David said:Sorry, there is no difference in scope between those two. The names
"a" and "b" are both introduced into the scope in which the declarations
occur.
In a namespace scope (including the global namespace scope), those
declarations illustrate the difference between internal linkage and
external linkage.
In a block scope, those declarations illustrate the difference between
automatic storage duration and static storage duration.
I think Victor had the correct answer.
E. Robert Tisdale said:I'm sure that you and Victor have the correct answer to some question
but I don't think that was the distinction
that Vipul Jain was looking for.
Victor said:I suppose you have a working crystal ball then,
since you definitely knew that
the OP wanted to know about linkage and not scope.
I just can't imagine that it was you who confused them...
E. Robert Tisdale said:Please elaborate for *me*
the difference between scope and linkage.
Please elaborate for *me* the difference between scope and linkage.
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.