C#怎么创建一维数组实例

[复制链接]
查看11 | 回复5 | 2018-12-15 02:02:01 | 显示全部楼层 |阅读模式
两种方法:1、告诉他你要多大的数组int[] arr=new int[100];//100就是数组的长度2、不告诉他有多大,直接告诉他数据组都有什么值int[] arr =new int[]{1,2,3,4,5,6,7,8,9};或者 int[] arr={1,2,3,4,5,6,7,8};扩展资料:常用的数组方法using System;using System.Collections;public abstract class Array : ICloneable, IList, ICol...
回复

使用道具 举报

千问 | 2018-12-15 02:02:01 | 显示全部楼层
1、创建包含6个元素的一维整型数组numbers、numbers1。int[] numbers =new int[6]; int[] numbers1 =new int[6]{0,0,0,0,0,0...
回复

使用道具 举报

千问 | 2018-12-15 02:02:01 | 显示全部楼层
创建数组 共有两种方法一:告诉他 你要多大的数组int[] arr=new int[100];//100就是数组的长度二、不告诉他有多大,直接告诉他 数据组都有什么值int[] arr =new int[]{1,2,3,4,5,6,7,8,9};或者 int[] arr={1,2,3,4,5,6,7,8};...
回复

使用道具 举报

千问 | 2018-12-15 02:02:01 | 显示全部楼层
int[]arr_int=new int[]{1,2,3,4,5};string[] arr_str=new string[]{"22","ss","aa","dd"};...
回复

使用道具 举报

千问 | 2018-12-15 02:02:01 | 显示全部楼层
int[]a = new int[5];int[] b = new int[]{1,2,3,4,5};...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行