> X: 11 Y: 21"> > X: 11 Y: 21">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

static void Main() { int i = 0; if (i == 0) { int a = 5; int b = 15; if (a == 5) { int c = 3; int d = 99; }

Similar presentations


Presentation on theme: "static void Main() { int i = 0; if (i == 0) { int a = 5; int b = 15; if (a == 5) { int c = 3; int d = 99; }"— Presentation transcript:

1

2

3

4

5 static void Main() { int i = 0; if (i == 0) { int a = 5; int b = 15; if (a == 5) { int c = 3; int d = 99; }

6

7

8

9

10

11 static void Main() { int i = 10; Foo(i); Console.WriteLine(”My number is: ” + i); } static void Foo(int number) { number++; } >> My number is: 10

12

13 static void Main() { Vector2 v = new Vector2(); v.x = 10; v.y = 20; Foo(v); Console.WriteLine("X: " + v.x + " Y: " + v.y)); } static void Foo(Vector2 vector) { vector.x++; vector.y++; } public class Vector2 { public int x; public int y; } >> X: 11 Y: 21

14

15 static void Main() { int i = 10; Foo(ref i); Console.WriteLine(”Number is: ” + i); } static void Foo(ref int number) { number++; } >> Number is: 11

16

17


Download ppt "static void Main() { int i = 0; if (i == 0) { int a = 5; int b = 15; if (a == 5) { int c = 3; int d = 99; }"

Similar presentations


Ads by Google