> X: 11 Y: 21"> > X: 11 Y: 21">
Download presentation
Presentation is loading. Please wait.
Published byAlexandria Brooks Modified over 10 years ago
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; }
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
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
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.