C#の配列定義
902 ワード
c#配列定義は従来のcとc++と少し異なり,new以降はdeleteを用いない.
using System;
using System.Text;
namespace Excise1
{
public class Program
{
public static void Main(string[] args)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
// c ,c#
/*
string array[5];
string []array;
int []array=new int[5]{1,2,3}; ,
*/
string []array;
array = new string[3];
string []array1 = new string[3] { "yes", "no", "no sure" }; //
string[] array2 = new string[] { "yes", "no", "no sure" }; //
string[] array3 ={ "yes", "no", "no sure" };// new
Console.ReadKey();
}
}
}