{"id":1115,"date":"2013-04-26T05:56:34","date_gmt":"2013-04-25T19:56:34","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1115"},"modified":"2013-04-26T05:56:34","modified_gmt":"2013-04-25T19:56:34","slug":"c-and-c-reference-pointer-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/c-and-c-reference-pointer-primer-tutorial\/","title":{"rendered":"C++ and C Reference Pointer Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/CPlusPlus\/ReferencePointer\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"C++ and C Reference Pointer Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/CPlusPlus\/ReferencePointer\/C_Reference_Pointer_Primer-1of.jpg\" title=\"C++ and C Reference Pointer Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">C++ and C Reference Pointer Primer Tutorial<\/p><\/div>\n<p>C and C++ love you to use pointers to memory and references because it is more direct and faster than the use of variables.    So in this tutorial we see four different ways to write a function that can change two different types of arrays (int[] and char[]).   In C++ and Java when you have enough similarity between data type functions as you can see here, you can set up templates, but that is for another tutorial.<\/p>\n<p><b>Background reading for tutorial:<\/p>\n<ul>\n<li><a target=_blank title='Pointer' href='http:\/\/en.wikipedia.org\/wiki\/Pointer_%28computer_programming%29'>Pointer<\/a><\/li>\n<li><a target=_blank title='Reference' href='http:\/\/en.wikipedia.org\/wiki\/Reference_%28computer_science%29'>Reference<\/a><\/li>\n<li><a target=_blank title='Array' href='http:\/\/en.wikipedia.org\/wiki\/Array_data_structure'>Array<\/a><\/li>\n<li><a target=_blank title='malloc' href='http:\/\/www.cplusplus.com\/reference\/cstdlib\/malloc\/'>malloc<\/a><\/li>\n<\/ul>\n<p><\/b>\n<\/p>\n<p>Here is a tutorial that introduces you to some C programming code for use of arrays, pointers, pointers to pointers, references and malloc &#8230;<\/p>\n<p>Let&#8217;s see some <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/CPlusPlus\/ReferencePointer\/'>C(++) via XCode<\/a> for this &#8230;<\/p>\n<p>Link to some downloadable programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/CPlusPlus\/ReferencePointer\/main.cpp_GETME' title='Download me'>main.cpp<\/a>  (or main.c &#8230; see how XCode can do C as well!) for use.\n<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d1115' onclick='var dv=document.getElementById(\"d1115\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=C%2B%2B\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d1115' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>C and C++ love you to use pointers to memory and references because it is more direct and faster than the use of variables. So in this tutorial we see four different ways to write a function that can change &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/c-and-c-reference-pointer-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[12,37,40],"tags":[176,960,997,1038,1319,1473],"class_list":["post-1115","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","category-xcode","tag-c","tag-pointer","tag-programming","tag-reference","tag-tutorial","tag-xcode"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/1115"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=1115"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/1115\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=1115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=1115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=1115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}