开发者

implement Pseudocode code without return in c# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_运维百科 Closed 10 years ago.

how can i implement this Pseudocode without return in c#(because i want to use it in button event handler)?thanks

edited:

 large_int example(large_int u,large_int v)

  {
     .
     .       
     .////some codes
     .
        x=u divide 10^2;
        w=v divide 10^2;
 return example(x,w)///it means when example(x,w) returns, x replace with u and w replace with v
}


You could pass in a variable that has to be set within the method.

MSDN on C# out keyword


You could make the method void, perform the same logic, and update something on your UI based on the result of the operation.

Not sure if you mean for ASP.NET, but if you do...

<asp:Button ID="myButton" Text="Do Stuff" runat="server" OnClick="My_Event_Method" />

protected void My_Event_Method(object sender, EventArgs e)
{
    example(someArg, someArg2);
}

private void example(int u, int v)
{
    // perform logic here and update your UI
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜