Can variables belonging to different scope have same name? If so show an example.

1 Answer(s)

Variables belonging to different scope can have same name as in the following code snippet.

int var;

void f() { 
   int var; 
}

main() { 
   int var; 
}
Supporter Answered on August 15, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.