CSDN博客

img bgu

[我的ASP.net学习历程]Reference

发表于2004/9/21 20:02:00  710人阅读

<%@ Page Language="C#" %>
<script runat="server">

    void Page_Load()
    {
        int a = 1;
  Increment(ref a);  //当形参改变时,实参也会改变
        lblMessage.Text = a.ToString();
    }
   
    void Increment(ref int Number)
    {
        Number += 1;
    }

</script>
<html>
<head>
    <title>Chapter 5 - Demonstration of Passing a Parameter by Reference</title>
</head>
<body>
    <asp:Label id="lblMessage" runat="server"></asp:Label>
</body>
</html>

0 0

相关博文

我的热门文章

img
取 消
img