Simple Question: Scope of declaring variables in and outside if statements

前端 未结 0 773
悲哀的现实
悲哀的现实 2021-02-05 21:39

I\'m a little confused right now.

Why can\'t I declare a variable with the same name after the scope of the if statement in C#?

if(true)
{
    int number =         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题