龙亿

------ 细细口味人生中的每一杯苦咖啡.

导航

.net中的函数可以返回多个值了

Posted on 2008-11-12 22:23  龙亿  阅读(305)  评论(0编辑  收藏  举报

 

Code
//通过out关键字
private string TestOut(out char i)

{

i
= 'a';
return “good study“;
}
private void button_Click(object sender,System.EventArgs e)

{
char i;//不必初始化
string getReturn = TestOut(out i);
richTextBox1.AppendText(“方法执行的返回值是:“
+getReturn+“\r\n“);
richTextBox1.AppendText(“返回out参数的值是:“
+i.ToString()+“\r\n“);

}