• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
一蓑烟雨
C/C++,Linux,语音技术
博客园    首页    新随笔    联系   管理    订阅  订阅
2011年11月30日
C/C++与C#区别(5)
摘要: 二维数组定义C/C++:int a[][]= {{1,1,3,2},{5,9,0,2},{3,4,7,5}}; int **a= {{1,1,3,2},{5,9,0,2},{3,4,7,5}};C#:二维固定矩阵 int[,] a={{1,1,3,2},{5,9,0,2},{3,4,7,5}}; 参差矩阵定义(二维可变数组):int[][] a=new int[3][];(1)C#下二维数组应用 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 ... 阅读全文
posted @ 2011-11-30 16:54 lovemu 阅读(289) 评论(0) 推荐(0)
foreach和for
摘要: 1、foreach循环与for循环输出结果比较,能达到一样的输出效果。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ForeachApplication 7 { 8 class Program 9 {10 static void Main(string[] args)11 {12 int[] a = { 1,5,9,20,16};13 ... 阅读全文
posted @ 2011-11-30 12:00 lovemu 阅读(287) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3