{"id":1381,"date":"2015-09-24T13:57:54","date_gmt":"2015-09-24T13:57:54","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=1381"},"modified":"2022-02-17T06:24:02","modified_gmt":"2022-02-17T06:24:02","slug":"delete-array-item","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/memory\/arrays\/delete-array-item","title":{"rendered":"Delete Array Item"},"content":{"rendered":"<p>\nThis is easier with a list as there&#39;s a built in function, but if you need to do it to an array:\n<\/p>\n<pre>\r\n<code>\r\n\tint IndexToRemove = 2;\r\n\tarray&lt;MyClassOrVariableName^&gt; ^MyClassOrVariableName1_temp = gcnew array&lt;MyClassOrVariableName^&gt;(MyClassOrVariableName1-&gt;Length - 1);\r\n\tfor (Count = 0; Count &lt; MyClassOrVariableName1-&gt;Length; Count++)\r\n\t{\r\n\t\tif (Count &lt; IndexToRemove)\r\n\t\t\tMyClassOrVariableName1_temp[Count] = MyClassOrVariableName1[Count];\r\n\t\telse if (Count &gt; IndexToRemove)\r\n\t\t\tMyClassOrVariableName1_temp[(Count - 1)] = MyClassOrVariableName1[Count];\r\n\t}\r\n\tMyClassOrVariableName1 = MyClassOrVariableName1_temp;\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is easier with a list as there&#39;s a built in function, but if you need to do it to an array: int IndexToRemove = 2; array&lt;MyClassOrVariableName^&gt; ^MyClassOrVariableName1_temp = gcnew array&lt;MyClassOrVariableName^&gt;(MyClassOrVariableName1-&gt;Length &#8211; 1); for (Count = 0; Count &lt; MyClassOrVariableName1-&gt;Length; Count++) { if (Count &lt; IndexToRemove) MyClassOrVariableName1_temp[Count] = MyClassOrVariableName1[Count]; else if (Count &gt; IndexToRemove) MyClassOrVariableName1_temp[(Count [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-1381","post","type-post","status-publish","format-standard","hentry","category-arrays"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/1381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=1381"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/1381\/revisions"}],"predecessor-version":[{"id":1382,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/1381\/revisions\/1382"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=1381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=1381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=1381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}