From aff77f1509de1f9f042cebe93b042d0ba9fd0545 Mon Sep 17 00:00:00 2001 From: preemeijer Date: Thu, 17 Aug 2017 21:34:36 +0200 Subject: [PATCH] C cheatsheet: Added pointers to c cheatsheet (#4099) * Added pointers to c cheatsheet * Removed the hard-tabs --- share/goodie/cheat_sheets/json/c.json | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/c.json b/share/goodie/cheat_sheets/json/c.json index ad8486a4d..b5aceae06 100644 --- a/share/goodie/cheat_sheets/json/c.json +++ b/share/goodie/cheat_sheets/json/c.json @@ -19,7 +19,8 @@ "Other Operators", "Conversion Characters", "Escape Sequences", - "Order of Precedence" + "Order of Precedence", + "Pointers" ], "sections": { "Arithmetic Operators": [ @@ -281,6 +282,24 @@ "val": "Comma - associativity goes from left to right", "key": "[ , ]" } + ], + "Pointers": [ + { + "val": "The memory address of the variable", + "key": "&" + }, + { + "val": "The memory address of the element inside an array", + "key": "&a[i]" + }, + { + "val": "Declaring a pointer to a variable", + "key": "*" + }, + { + "val": "Declaring a void pointer", + "key": "void *" + } ] } -} \ No newline at end of file +}