日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
C#參數(shù)數(shù)列簡單概述

在向大家詳細介紹C#參數(shù)數(shù)列之前,首先讓大家了解下C#種的四種參數(shù)形式,然后全面介紹C#參數(shù)數(shù)列。

在微軟的.NET推出后,關(guān)于C#的有關(guān)文章也相繼出現(xiàn),作為微軟的重要的與JAVA抗衡的語言,C#具有很多優(yōu)點。本文將選一些C#語言中的重要知識詳細介紹

C#種的四種參數(shù)形式:
◆一般參數(shù)
◆in參數(shù)
◆out參數(shù)
◆C#參數(shù)數(shù)列
本文只介紹C#參數(shù)數(shù)列

C#參數(shù)數(shù)列

C#參數(shù)數(shù)列能夠使多個相關(guān)的參數(shù)被單個數(shù)列代表,換就話說,C#參數(shù)數(shù)列就是變量的長度。

 
 
 
  1. using System;
  2. class Test
  3. {
  4. static void F(params int[] args) {
  5. Console.WriteLine("# 參數(shù): {0}", args.Length);
  6. for (int i = 0; i < args.Length; i++)
  7. Console.WriteLine("\targs[{0}] = {1}", i, args[i]);
  8. }
  9. static void Main() {
  10. F();
  11. F(1);
  12. F(1, 2);
  13. F(1, 2, 3);
  14. F(new int[] {1, 2, 3, 4});
  15. }
  16. }
  17. 以下為輸出結(jié)果:
  18. # 參數(shù): 0
  19. # 參數(shù): 1
  20. args[0] = 1
  21. # 參數(shù): 2
  22. args[0] = 1
  23. args[1] = 2
  24. # 參數(shù): 3
  25. args[0] = 1
  26. args[1] = 2
  27. args[2] = 3
  28. # 參數(shù): 4
  29. args[0] = 1
  30. args[1] = 2
  31. args[2] = 3
  32. args[3]

分享標(biāo)題:C#參數(shù)數(shù)列簡單概述
文章網(wǎng)址:http://m.5511xx.com/article/dhhpeso.html