summaryrefslogtreecommitdiffhomepage
path: root/vala.html.markdown
diff options
context:
space:
mode:
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/).