AlamaFromBe
Member
- Joined
- Jan 27, 2020
- Messages
- 12
- Programming Experience
- 10+
Hello everyone, I'm coming to you for a question that will probably seem silly to you, But I can't do a simple method (function) that returns an object and especially to retrieve it in the calling function. Kind:
Or:
I specify that I seek, but did not find a clear and precise answer.
C#:
int result = int myFunc () {return 25};
Or:
C#:
using System;
public class Program
{
public static void Main()
{
int result = int myFunc();
Console.WriteLine(result);
}
int myFunc()
{
// Code à exécuter quand la méthode est appelée.
return 12;
}
}
I specify that I seek, but did not find a clear and precise answer.