• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
一蓑烟雨
C/C++,Linux,语音技术
博客园    首页    新随笔    联系   管理    订阅  订阅
2011年12月7日
委托(delegate)
摘要: 1、先看一个委托的例子 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace DeleGate 7 { 8 public delegate void GreetingDelegate(string name);//委托 9 10 class Program11 {12 private static void EnglishGreeting(string name)13 {14 ... 阅读全文
posted @ 2011-12-07 17:00 lovemu 阅读(246) 评论(0) 推荐(0)
结构与重载
摘要: 1、结构跟C中类似,优点:集中处理常见任务,简化过程; 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace StructTest 7 { 8 struct huanghuang 9 { 10 public string firstName,lastName;11 public string wholeName()12 { 13 return f... 阅读全文
posted @ 2011-12-07 11:55 lovemu 阅读(197) 评论(0) 推荐(0)
变量的作用域
摘要: 1、C#的变量仅能从代码的本地作用域访问,访问该变量要通过这个作用域来实现写个例子:(1)访问不了的情况 error 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace bianliang 7 { 8 class Program 9 {10 11 static void display()12 {13 Console.WriteLine("result:{0... 阅读全文
posted @ 2011-12-07 11:00 lovemu 阅读(206) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3