Login
Remember
Register
Ask a Question
Is it possible to access a global variable from a block where local variables are defined?
0
votes
asked
Jan 6, 2024
in
C Plus Plus
by
GeorgeBell
uppose a global variable and local variable have the same name. Is it possible to access a global variable from a block where local variables are defined?
c-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 6, 2024
by
GeorgeBell
No. This isn’t possible in C. It’s always the most local variable that gets preference.
...