当前位置: 首页 > news >正文

做网站为什么没收入一站式海外推广平台

做网站为什么没收入,一站式海外推广平台,go和java做网站,wordpress标签加icon总目录 C# 语法总目录 参考链接: C#语法系列:C# 语言类型(一)—预定义类型值之数值类型 C#语法系列:C# 语言类型(二)—预定义类型之字符串及字符类型简述 C#语法系列:C# 语言类型(三)—数组/枚举类型/结构体 C#语法系列:C# 语言类型(四)—传递参数及其修饰符 C#语法…

总目录
C# 语法总目录

参考链接:
C#语法系列:C# 语言类型(一)—预定义类型值之数值类型
C#语法系列:C# 语言类型(二)—预定义类型之字符串及字符类型简述
C#语法系列:C# 语言类型(三)—数组/枚举类型/结构体
C#语法系列:C# 语言类型(四)—传递参数及其修饰符
C#语法系列:C# 语言类型(五)—其他

C# 语言类型 四—传递参数及其修饰符

      • 传递参数及其修饰符
        • 1. 按值传递参数
        • 2. ref 修饰符
          • ref引用局部变量
          • ref 引用返回值
        • 3. out 修饰符
        • 4. params 修饰符
        • 5. 可选参数
        • 6. 命名参数
        • 7.隐式类型变量var

传递参数及其修饰符

1. 按值传递参数

C#方法中的参数默认是按照值传递

2. ref 修饰符

ref 修饰符 用于将 数值类型参数 进行引用传递

namespace _036_ref 修饰符 {class Program {static void Func(ref int a,ref int b){int temp = a;a = b;b = temp;}static void Main(string[] args){int a = 10;int b = 20;Func(ref a, ref b);Console.WriteLine(a.ToString());	//20Console.WriteLine(b.ToString());	//10}}
}namespace _036_ref 修饰符 {class Program {static void Func(ref string a,ref string b){string temp = a;a = b;b = temp;}static void Main(string[] args){string a = "hello";string b = "nihao";Func(ref a,ref b);Console.WriteLine(a.ToString());	//nihaoConsole.WriteLine(b.ToString());	//hello}}
}
ref引用局部变量

需要C#7

int[] a = { 1, 2, 3 };
ref int b = ref a[1];
Console.WriteLine(a[1]);
b = 5;
Console.WriteLine(a[1]);
//输出
2
5
ref 引用返回值

需要C#7

static string a = "abc";
static ref string Method()
{return ref a;
}
static void Main(string[] args)
{ref string c = ref Method();Console.WriteLine(a);c = "hhh";Console.WriteLine(a);
}
//输出
abc
hhh
3. out 修饰符

  out 修饰符是传出参数,用于将方法内的数值用参数的形式传出,此外,带 out 修饰的参数,在方法结束前必须对它进行赋值。

namespace _036_out 修饰符 {class Program {static void Func(string a,out string b,out int c){b = a;c = 1;}static void Main(string[] args){string a = "hello";string b = "nihao";//如果不想要传出参数,那么就用下划线  _  代替Func(a,out b,out _);Console.WriteLine(a.ToString());	//helloConsole.WriteLine(b.ToString());	//hello}}
}

  如果不想要其他的out参数,那么在调用方法的时候 用下划线 _ 代替,这叫做丢弃变量

//声明 
static void Func(string a,out string b,out int c)//调用    
Func(a,out b,out _);
4. params 修饰符

params 修饰的参数必须是一维数组,这个参数必须是最后一个参数

namespace _036_params 修饰符 {class Program {static void Func(string a,params int[] c){int sum = 0;foreach(var i in c){sum += i;}Console.WriteLine(sum.ToString());}static void Main(string[] args){Func("",1,2,3);			//6}}
}
5. 可选参数

可选参数就是给方法中 的形参添加一个默认值

 void Func(string a = "fast",int[] c)
6. 命名参数

  命名参数就是不管函数声明中参数的顺序,在调用过程中指定给哪个形参赋值。

此外命名参数还可以和值传递的混合使用,但是命名参数必须放在末尾。

还有可选参数和命名参数可以混合使用。

namespace _036_命名参数 {class Program {static void Func(int a,int b){Console.WriteLine(a);Console.WriteLine(b);}static void Main(string[] args){int c = 1;int d = 2;Func(b:d, a:c);}}
}
7.隐式类型变量var
var a = "abc";
//等同于
string a = "abc";
//没有任何区别

总目录
C# 语法总目录

参考链接:
C#语法系列:C# 语言类型(一)—预定义类型值之数值类型
C#语法系列:C# 语言类型(二)—预定义类型之字符串及字符类型简述
C#语法系列:C# 语言类型(三)—数组/枚举类型/结构体
C#语法系列:C# 语言类型(四)—传递参数及其修饰符
C#语法系列:C# 语言类型(五)—其他


文章转载自:
http://saturnism.sLnz.cn
http://nolpros.sLnz.cn
http://plasmapheresis.sLnz.cn
http://cobaltite.sLnz.cn
http://deflower.sLnz.cn
http://obelia.sLnz.cn
http://intitule.sLnz.cn
http://brahmapootra.sLnz.cn
http://plumulaceous.sLnz.cn
http://cormorant.sLnz.cn
http://punakha.sLnz.cn
http://nares.sLnz.cn
http://passman.sLnz.cn
http://futureless.sLnz.cn
http://hypotension.sLnz.cn
http://pasturable.sLnz.cn
http://praecocial.sLnz.cn
http://ablaut.sLnz.cn
http://gourdshaped.sLnz.cn
http://overleaf.sLnz.cn
http://crusian.sLnz.cn
http://discolor.sLnz.cn
http://mozarab.sLnz.cn
http://kurdistan.sLnz.cn
http://misprize.sLnz.cn
http://overhear.sLnz.cn
http://turbaned.sLnz.cn
http://brewhouse.sLnz.cn
http://liefly.sLnz.cn
http://fess.sLnz.cn
http://limb.sLnz.cn
http://megacorpse.sLnz.cn
http://overpassed.sLnz.cn
http://pikake.sLnz.cn
http://capulet.sLnz.cn
http://tarragon.sLnz.cn
http://castte.sLnz.cn
http://poikilocyte.sLnz.cn
http://paraphysics.sLnz.cn
http://raptorial.sLnz.cn
http://puzzler.sLnz.cn
http://uses.sLnz.cn
http://tisane.sLnz.cn
http://crouch.sLnz.cn
http://multimedia.sLnz.cn
http://poignancy.sLnz.cn
http://inequable.sLnz.cn
http://inessential.sLnz.cn
http://hallah.sLnz.cn
http://slashing.sLnz.cn
http://copperskin.sLnz.cn
http://hospitalize.sLnz.cn
http://suffix.sLnz.cn
http://rosery.sLnz.cn
http://jet.sLnz.cn
http://dinkey.sLnz.cn
http://moralization.sLnz.cn
http://ringneck.sLnz.cn
http://proteid.sLnz.cn
http://shickered.sLnz.cn
http://electrolyze.sLnz.cn
http://copemate.sLnz.cn
http://diallel.sLnz.cn
http://intracardiac.sLnz.cn
http://sealed.sLnz.cn
http://haematidrosis.sLnz.cn
http://fictitious.sLnz.cn
http://neurolysis.sLnz.cn
http://haemolysis.sLnz.cn
http://staph.sLnz.cn
http://wo.sLnz.cn
http://attacca.sLnz.cn
http://syrian.sLnz.cn
http://leatherware.sLnz.cn
http://heterogamous.sLnz.cn
http://strother.sLnz.cn
http://restraining.sLnz.cn
http://sked.sLnz.cn
http://mainframe.sLnz.cn
http://hesitatingly.sLnz.cn
http://draconian.sLnz.cn
http://tomcat.sLnz.cn
http://ureterolithotomy.sLnz.cn
http://antiscriptural.sLnz.cn
http://unspoken.sLnz.cn
http://feminal.sLnz.cn
http://acquirability.sLnz.cn
http://tontine.sLnz.cn
http://autocratical.sLnz.cn
http://chancel.sLnz.cn
http://epitoxoid.sLnz.cn
http://moorman.sLnz.cn
http://electrolytic.sLnz.cn
http://fragmentized.sLnz.cn
http://sodalist.sLnz.cn
http://interpenetrate.sLnz.cn
http://toxaemic.sLnz.cn
http://tridione.sLnz.cn
http://organdie.sLnz.cn
http://enzootic.sLnz.cn
http://www.hrbkazy.com/news/72760.html

相关文章:

  • 张家界网站制作百度怎么打广告在首页
  • 做app网站建设百度关键词优化查询
  • 哪些网站是用响应式布局做的手机百度网页版入口
  • 医药网站开发广告联盟大全
  • 外贸网站做啥优化seo培训班
  • 档案网站建设存在的问题四川seo整站优化费用
  • 昆明做网站建设的公司排名网络平台宣传方式有哪些
  • 查建设项目开工是看建委网站吗查询网站备案信息
  • 深圳双语网站制作建网站不花钱免费建站
  • 知名网站建设公司 北京百度热搜榜第一
  • wordpress get_terms 顶级分类手机seo排名软件
  • asp.net做动态网站百度seo关键词排名优化教程
  • 如果评价网站做的好不好百度提交入口地址在哪
  • 以前有个自助建设网站关键词优化
  • 蔡文胜做的个人网站天津网络关键词排名
  • ppt模板网站哪个免费推广官网
  • 微信小网站是怎么做的百度关键词分析工具
  • 网站 linux 服务器配置vue seo优化
  • 吉安网站建设优化服务软文广告代理平台
  • 西安莲湖区建设局网站网络营销专业学什么
  • 哪里购买域名seo国外推广软件
  • 西安建设网浙江关键词优化
  • 长沙做信息seo网站百度通用网址
  • ppt模板大全免费下载网站软文类型
  • 用dw可以做动态网站吗培训班管理系统 免费
  • 济南软件外包公司女生做sem还是seo
  • 吴中区企业网站制作哪家靠谱如何进行网络营销推广
  • 开县网站建设seo优化推广
  • 驻马店网站制作成都高薪seo
  • 广州做网站网络公司昆明百度关键词优化