Created
March 3, 2014 19:58
-
-
Save nvasilakis/9333331 to your computer and use it in GitHub Desktop.
A first vala example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Take for example the following methods: | |
| void method_1(int a, out int b, ref int c) { | |
| //implementation | |
| } | |
| void method_2(Object o, out Object p, ref Object q) { | |
| //implementation | |
| } | |
| // Which are later called with values | |
| int a = 1; | |
| int b; | |
| int c = 3; | |
| method_1(a, out b, ref c); | |
| Object o = new Object(); | |
| Object p; | |
| Object q = new Object(); | |
| method_2(o, out p, ref q); | |
| // Possible implementation of method1 | |
| void method_1(int a, out int b, ref int c) { | |
| b = a + c; | |
| c = 3; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment