Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Is it possible to access a global variable from a block where local variables are defined?
Home
C Plus Plus
Is it possible to access a global variable from a block where local variables are defined?
asked
Jan 6
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
by
GeorgeBell
No. This isn’t possible in C. It’s always the most local variable that gets preference.
...