- The ref parameter can be input using either of the following methods: Pass the value or transfer the address. The ref parameter is the transfer address.
- Output. It is equivalent to a function that can have multiple return values, which is unique in C #.
- Params, Which is used before an array parameter. Multiple values can be assigned.
- Enum is a type defined by a programmer, which is the same as a class or structure.
For example
// Static void add (ref int N) // static void add (int n) Static int add (int n, out int p) {int M = N * 10; P = m; // console. writeline ("add function 1: {0}", n); n = N + 10; // console. writeline ("add function 2: {0}", n); Return N;} static void main (string [] ARGs) {int A = 5; // console. writeline ("Main Function 1: {0}", a); // Add (Ref A); int B; A = add (, out B); console. writeline ("A = {0} B = {1}", a, B); // console. writeline ("Main Function 2: {0}", );
Recursion: the feature of recursion is to call yourself. Return is to return the value to the upper level.
For example:
Static int taozi (INT day) {If (Day = 10) {return 1;} int now = (taozi (day + 1) + 1) * 2; return now ;} static void main (string [] ARGs) {// recursive int n = taozi (1); console. writeline ("{0} peaches in the park", N );
20140830 function Recursion