summaryrefslogtreecommitdiffhomepage
path: root/vala.html.markdown
diff options
context:
space:
mode:
authorMilo Gilad <milogaccnts@gmail.com>2017-08-26 11:30:06 -0400
committerMilo Gilad <milogaccnts@gmail.com>2017-08-26 11:30:06 -0400
commit5eb6c15162a1a15507fb20497a02d17a7d6a926a (patch)
tree3ac293a3bc05b7b02d19b14d9244c02cfc053f04 /vala.html.markdown
parent0fa0305aaeec6b94274a0f7f94f52cf407ac2575 (diff)
added pointers section
Diffstat (limited to 'vala.html.markdown')
-rwxr-xr-xvala.html.markdown13
1 files changed, 12 insertions, 1 deletions
diff --git a/vala.html.markdown b/vala.html.markdown
index 5ff3486c..9a48aee9 100755
--- a/vala.html.markdown
+++ b/vala.html.markdown
@@ -473,7 +473,18 @@ void main() {
loop.run();
}
-// Pointers
+// Pointers (manual memory management)
+
+Object* pointer_obj = new Object(); // Creates Object instance and gives pointer
+
+pointer_obj->some_method(); // Executes some_method
+pointer_obj->some_data; // Returns some_data
+
+delete pointer_obj;
+
+int more = 57;
+int* more_pointer = &i; // & = address-of
+int indirection_demo = more_pointer*; // indirection
```
* More Vala documentation can be found [here](https://valadoc.org/).