摘要: C#的层级:Variables:C#中使用Variable必须先declare变量的类型type nameint myNumber;string message;Scope: 1:注意scope的使用范围: intmyFunction(){ intx=10; x++;//ok for(inti=0;i<10;i++) { inty=x+20;//ok //othercode... } x++;//ok y+=20; //erroryisnotavailablehere} 2:父子scope或者同一scope里不可以重新声明同一个变量:Ca... 阅读全文
posted @ 2012-11-06 00:10 若愚Shawn 阅读(317) 评论(0) 推荐(0) 编辑