C#函数参数_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > C#函数参数

C#函数参数

 2014/10/5 17:14:50  麻将我会  程序员俱乐部  我要评论(0)
  • 摘要:当函数接受参数时,必须指定下属内容函数在其定义中指定参数列表,以及这些参数的类型在每个函数调用中匹配参数列表参数匹配:当调用函数时,必须使参数与函数定义中指定的参数完全匹配,这意味着要匹配参数的类型、个数和顺序参数数组C#允许为函数指定一个(只能指定一个)特定的参数,这个参数必须是函数定义中的最后一个参数,称为参数数组,参数数组可以使用个数不定的参数调用函数,使用params来定义。值参数其含义是,使用值参数时,是把一个值传递给函数使用的一个变量,在函数中对此值的任何修改
  • 标签:C# 函数

当函数接受参数时,必须指定下属内容

  1. 函数在其定义中指定参数列表,以及这些参数的类型
  2. 在每个函数调用中匹配参数列表
  • 参数匹配:当调用函数时,必须使参数与函数定义中指定的参数完全匹配,这意味着要匹配参数的类型、个数和顺序
  • 参数数组

    C#允许为函数指定一个(只能指定一个)特定的参数,这个参数必须是函数定义中的最后一个参数,称为参数数组,参数数组可以使用个数不定的参数调用函数,使用params来定义。

  • 值参数

    其含义是,使用值参数时,是把一个值传递给函数使用的一个变量,在函数中对此值的任何修改,都不影响函数调用中指定的参数,所以下面的输出i的值仍然为5;
    QQCugDdEmVrSuSjabTSaT0Wh0cXFxenr69u3bp06dOnr06N/9/T+cOP2X9Ja8mJFnkvJMUr5vJ6bXa+K+ErV5ZpyGrT2pxno1pu1EiBprcmhNDtJiyhAJeSohTybkyYQMrYA2RD+xonVV4vH48vLygwcPvvvuu6tXryr9lBOnzsUKDk/gGpWoNtF7YVaJlO2YcRbC/WXhJqp99MaxfX8qAE2OMgIyd1VWV1cXFhZCodDQ0NDnn3/+8ssv//BHz6a3nDuFahPFIw/UeJiSH25UYo4vHjqLVDUe2Am62lQn8jjI7B30VkC7oWlF+V65UCgoM7XLy8sPHz4cHx8fGBg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DkGr/bAACC4dfK9uPy9LqsRGhdDq3LwXU5VUJvxTV+twEABMOvlc298tCKNLQs3VqWbi1LN5elW8vSah69Fdf42wIAEA6/Vop75VtL0s0l6eaSdEOJR1IkB624xu82AIBgbGhlt2xwynVoRQh+twEABGNXK3qnQCti8LsNACAYJ1p5BK2I5P8B/CafB0HBkSkAAAAASUVORK5CYII=" alt="" />

  • canshu.html" target="_blank">引用参数(ref关键词):函数处理的变量和函数调用使用的变量相同,而不仅仅是值相同的变量,因此对这个变量的任何修改都会影响用作参数的变量值输出参数

    CMSrYkqL6jzTbkOqJ5WIVyIgE349KGY3AIhj3rgxpjaRSGR5eXl2dvaHH364evWqNq85cerses7liV2lGN0yZl/MaJGUjml3USevUegGAEG0lZR9arO6uhoKhfx+/+jo6Jdffvnqq6/+6MfPp7fcu4ZpGc0vs3o8TqqPU+WYE4vH7iJZiVmZsMuOQjcACGLoRvv+O5fLaTvEy8vLjx8/fvDgwdDQ0MmTJ1944YVPPjsb2vAwqTGJxmwZs1zm0+UIisW8u0hVQlBqnKDQDQCCaBs35k3iZDK5vr6+sLAwPT197969y5cvf/zxx88898LmjpvNGmNSYxGNNpGZ0077tBpMq6G0GtpQF/RY5MaC5whJRpAZaUndwDigkzF0o11uk8lk4vH46upqMBj0+/23b9++cOHC8ePHn3nuhe196npeY7jGmNFootEmKSHDLxl1KaMuZdTlTV4suYuMy1h0ig11cUNGNwB0OGbd5HK5jY0NYyX16NGjW7dunTt37v3335fVDcM1lkmNWTSaYjLq8qa6sqmGN9Vwtt6xWYkVmeCLb3kTugFAGGOf2Ni4WV9fX1pampmZefDgwfXr18+ePfvee+/xdXP17tT57+5o8eXVcpy/Wk4Z0OPCd3eGxgOzidJ8Wg2lyzOaJd0yK5tqOKuuZtW1rLqWU9dZseYuspVYrVMYIqPQDQCCmPeJtRsXtMttpqen79+/Pzw83N/f39vby9fNha++feibeeibtsXMhH9mwj9zefj25aGxy0Njfz5/6S+hdNk1mYprwll1uLeLEEJ6B890k0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xlSWTmZIx7dQ3MOqln3TilAxe40M2wWTcZ6AZXFbcxROx3ajjZ+DUAKTzpJgTdQDftivkdAm2CrG6GoZtqKHQDgCBSurG4Broh0A0A4rjUTQi6KUOhGwAEgW48QqEbAARxo5tQJZahm5q6MfIB0OFI68bkmiHoRnB2Q6AbAGR1U+0a6IZANwCI4043Q9CNDoVuABAEuvEIhW4AEMSFboagGxNU8JspAuOAjkdWN0PQTTUUsxsABJHSzRB0Y4NCNwAIAt14hEI3AAgC3XiEQjcACALdeITiqmIABIFuPEJxzxQAgkA3HqHQDQCCQDceodANAIJANx6h0A0AgkA3HqHQDQCCQDceodANAIJANx6h0A0AgkA3HqHQDQCgaUA3AIAmAd0AAJoEdAMAaBLQDQCgSUA3AIAmAd0AAJoEdAMAaBLQDQCgSUA3AIAm8f/RbX7FwHJUzwAAAABJRU5ErkJggg==" alt="" />用作ref参数的两个限制:首先不能是常量,再者必须使用初始化过的变量

  • 输出参数(Out关键词):与ref类似但有区别
    • 把未赋值的变量用作ref参数时非法的,但可以把未赋值的参数用作Out参数
    • 在函数中使用Out参数时,Out参数被看作是未赋值的,所以使用之前在函数内需要对Out参数初始化,否则会报如下错误

发表评论
用户名: 匿名