public string test(int sql, string tb, string td){ return ……},如何将这三个值返回调用处?谢谢。

wtoeb 2004-07-08 03:26:51
public string test(int sql, string tb, string td)
{
return ……
}
如何将这三个值返回调用处?即是return后面怎么写?
谢谢。
...全文
242 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
happyjun2000 2004-07-09
  • 打赏
  • 举报
回复
方法一
public void test(ref int a, ref string b, ref string c)
方法二
public string test(out int sql,out string tb, out string td)
方法三
struct threeValue
{
int sql;
string tb;
string td;
}
public threeValue test(threeValue value)
{
value.sql=1;
value.tb="1";
value.td="1";
return value;
}
jxhql 2004-07-09
  • 打赏
  • 举报
回复
public void test(ref int a, ref string b, ref string c)
melonlee 2004-07-08
  • 打赏
  • 举报
回复
public void test(ref int a, ref string b, ref string c)
{
a=1;
b=2;
c=3;
}
调用
int a,b,c
a=0;
b=0;
c=0;
test(1,2,3)
//result a=1,b=2,c=3
lxcc 2004-07-08
  • 打赏
  • 举报
回复
private void Button2_Click(object sender, System.EventArgs e)
{
int ii=0;
string ss="";
double dd=0;
Test(ref ii,ref ss, ref dd);

Response.Write(ii.ToString()+"<br>");
Response.Write(ss+"<br>");
Response.Write(dd.ToString()+"<br>");
}

private void Test(ref int i,ref string s ,ref double d)
{
i=1;
s="2";
d=3.00;
}
lxcc 2004-07-08
  • 打赏
  • 举报
回复
public void test(ref int sql, ref string tb, ref string td)
sharpblade 2004-07-08
  • 打赏
  • 举报
回复
public string test()
返回一個字符串
你這樣一個函數return不行
chenyuming2004 2004-07-08
  • 打赏
  • 举报
回复
把函数声明改成下面
public string test(out int sql,out string tb, out string td)
{
}


这样调用
test(out 5,out "666",out "sdlksd");

去查查out的意思吧。
小贵子88 2004-07-08
  • 打赏
  • 举报
回复
leettt(等着瞧) 说的不错了
public string test(out int sql,out string tb, out string td)
{
//记得返回前一定要对对sql/tb/td赋值
}

调用
int a;
string b,c;
string s=test(out a,out b,out c);
wtoeb 2004-07-08
  • 打赏
  • 举报
回复
能不能详细些嘛,各位!!!
云孤天 2004-07-08
  • 打赏
  • 举报
回复
用ref声明参数
wtoeb 2004-07-08
  • 打赏
  • 举报
回复
private void Page_Load(object sender, System.EventArgs e)
{
int a;
int b;
int c;
id=1;
test(a,b,c);
}
public string test(int a, int b, int c)
{
a=a*2;
b=b*a;
c=c*b;
return …… //即是如何返回a,b,c这三个值?
}
leettt 2004-07-08
  • 打赏
  • 举报
回复
public string test(out int sql,out string tb, out string td)
{
}
chinawn 2004-07-08
  • 打赏
  • 举报
回复
想返回什么就返回
cjzlxy 2004-07-08
  • 打赏
  • 举报
回复
不大明白楼主的意思???
内容概要:本文档详细介绍了基于非线性反步法与Lyapunov函数相结合的模型预测控制(Lyapunov-MPC)在自主水下航行器(AUV)轨迹跟踪中的应用,涵盖经典的Fossen六自由度动力学建模。研究通过融合反步法的系统化递推设计优势与MPC的滚动优化及约束理能力,构建了一种高性能、强鲁棒性的复合控制策略,有效提升了AUV在复杂海洋环境下的轨迹跟踪精度与系统稳定性。文档提供了完整的Matlab代码实现方案,适用于高水平学术论文(如SCI一区)的复现与科研验证,具有较强的理论深度与工程实践价。; 适合人群:具备自动控制理论、非线性系统分析、现代控制方法(如反步法、李雅普诺夫稳定性理论、MPC)基础,并熟悉Matlab/Simulink仿真工具的研究生、科研人员及从事水下机器人、无人系统控制开发的工程技术人员。; 使用场景及目标:①用于高精度AUV轨迹跟踪控制系统的设计与仿真验证;②深入学习和掌握非线性反步法的设计流程、Lyapunov稳定性分析方法及其与MPC框架的集成技巧;③服务于高水平学术论文的复现、算法对比与技术创新研究,推动水下航行器智能控制技术的发展。; 阅读建议:建议读者首先深入理解Fossen动力学模型的物理意义与数学表达,重点剖析反步法的虚拟控制量构造与李雅普诺夫函数的设计思路,进而研究如何将稳定性条件融入MPC的优化目标中。务必结合所提供的Matlab代码进行逐行调试与参数敏感性分析,通过仿真实验直观感受不同海况与初始偏差下的控制性能,从而深刻理解理论设计与实际效果之间的内在联系。

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧