C# work with functions

Posted by gloris on Stack Overflow See other posts from Stack Overflow or by gloris
Published on 2010-05-20T05:22:07Z Indexed on 2010/05/20 5:30 UTC
Read the original article Hit count: 158

Filed under:

Hi, I'am new with C#. How works in C# functions?

My try:

        private void Form1_Load(object sender, EventArgs e)
    {
        MessageBox.Show(Convert.ToString(number_p(5)));            
    }

    public void number_p(int number)
    {
        int one = 1;
        number = number + one;
        return number;
    }

Error: return, why? Thanks

© Stack Overflow or respective owner

Related posts about c#