{"id":2020,"date":"2014-02-09T11:42:06","date_gmt":"2014-02-09T07:42:06","guid":{"rendered":"http:\/\/nayarweb.com\/blog\/?p=2020"},"modified":"2014-02-09T11:45:07","modified_gmt":"2014-02-09T07:45:07","slug":"understanding-using-c-pointers","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2014\/understanding-using-c-pointers\/","title":{"rendered":"[Book Review] Understanding and Using C Pointers"},"content":{"rendered":"<p><code><\/p>\n<pre>@book{reese,\r\n    author    = \"Richard Reese\",\r\n    title     = \"Understanding and Using C Pointers\",\r\n    edition   = \"First\",\r\n    year      = \"2013\",\r\n    publisher = \"O'Reilly\",\r\n}<\/pre>\n<p><\/code><\/p>\n<p>Thanks to the <a href=\"http:\/\/www.meetup.com\/MauritiusSoftwareCraftsmanshipCommunity\/\">Mauritius Software Craftmanship Community (MSCC)<\/a>, i got access to the book &#8220;Understanding and Using C Pointers&#8221; by Richard Reese. I read only the first 3 chapters till now. It&#8217;s like really lots to disgest. <\/p>\n<p><center><a href=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2014\/02\/cpointers.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2014\/02\/cpointers-225x300.jpg\" alt=\"cpointers\" width=\"225\" height=\"300\" class=\"aligncenter size-medium wp-image-2026\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2014\/02\/cpointers-225x300.jpg 225w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2014\/02\/cpointers.jpg 450w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/center><\/p>\n<p>I got interested in the book because i am doing my BSc final year project using C++. C\/C++ programmers usually use pointers a lot. Reese says <\/p>\n<blockquote><p>&#8220;a solid understanding of pointers and the ability to effectively use them separates a novice C programmer from a more experienced one.&#8221;<\/p><\/blockquote>\n<p>Unfortunately the book doesn&#8217;t illustrate the difference between a pointer and a &#8220;normal&#8221; variable. Having read the first 3 chapters still makes me wondering when should i use pointers and even is it really worth it?<\/p>\n<p>In the first year at university in python class, my lecturer mentioned that arrays are passed by reference to functions in almost all programming language.<\/p>\n<p><code><\/p>\n<pre>void change(int array[], int pos,int newval){\r\n    array[pos] = newval;\r\n}\r\n\r\nint main()\r\n{\r\n    int x[] = {1,2,3};\r\n    change(x,2,5);\r\n    std::cout << x[2] << endl;\r\n    return 0;\r\n}<\/pre>\n<p><\/code><br \/>\n5 will be outputed on the screen i.e. x was passed by reference. What advantage would i get for using pointer notation instead? <\/p>\n<p>I find the book too hard containing too much information for beginners. I'd recommend the book to people who already have a basic knowledge of pointers. The book will improve your pointer skills with \"best practices\" so that you become really proficient in pointers. \ud83d\ude42<\/p>\n<p>The book doesn't illustration in Object Oriented Programming. I guess that is because C doesn't support OOP. <\/p>\n<h2>Conclusion<\/h2>\n<p>- Cannot be used as \"introduction\" to pointers to newbies<br \/>\n- If you're already using pointers, do read the book. It'll make you become a pointer guru for sure!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>@book{reese, author = &#8220;Richard Reese&#8221;, title = &#8220;Understanding and Using C Pointers&#8221;, edition = &#8220;First&#8221;, year = &#8220;2013&#8221;, publisher = &#8220;O&#8217;Reilly&#8221;, } Thanks to the Mauritius Software Craftmanship Community (MSCC), i got access to the book &#8220;Understanding and Using C Pointers&#8221; by Richard Reese. I read only the first 3 chapters till now. It&#8217;s like &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2014\/understanding-using-c-pointers\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">[Book Review] Understanding and Using C Pointers<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11,184],"class_list":["post-2020","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-book","tag-pointer"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=2020"}],"version-history":[{"count":7,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2020\/revisions"}],"predecessor-version":[{"id":2029,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/2020\/revisions\/2029"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=2020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=2020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=2020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}