c++ deleting elements in a struct array
<p>The code below takes a users input for 2 properties and stores it. I've been failing to find a way to <strong>delete</strong> the information on a property if it is removed from the market by prompting the user to enter the property-ID to be removed and also <strong>update</strong> the property details such as changing the Asking Price by prompting the user to enter the property-ID. My teacher recommended using a structure array which I have managed to do so far.</p>

<pre><code>#include &lt;iostream&gt;                                           // takes users input and prints out output 
#include&lt;conio.h&gt;                                             // declares several useful library functions for performing "console input and output"
#include &lt;stdio.h&gt;                                            // compiler directive which stores standard input output 
using namespace std;                                          // defines the standard namespace 
struct Property                                               // declares the struct as Property 
{
   int ID[3];                                                // declare variable "ID" of data type interger to identify property ID 
   int Asking_Price;                                         // declare variable "Asking_Price" of data type interger to to identity the asking price for the property
   char Type[10];                                            // declare variable "Type" of data type char to identify the property type (detatched, semi-detatched, terraced, flat, commercial)
   char Address[20];                                         // declare variable "Address" of data type char to identify the property address
};
int main()  

{
   Property My_Property[2];                                      // declare the struct, the array and the number of array elements 
   for (int i=0;i&lt;2;i++)                                         // for loop counts the number of properties from 1 to 5
   {
      cout &lt;&lt; "\n  Details of property ID " &lt;&lt; i + 1 &lt;&lt; " are :\n"; // Prints out the property ID 

      cout &lt;&lt; "\t Enter the property asking price : ";             // Prompts the user to enter asking price fopr the property  
      cin &gt;&gt; My_Property[i].Asking_Price;                          // Takes users input and stores it in the array 

      cout &lt;&lt; "\t Please enter the property type: ";               //Prompts the user to enter the property type
      cin&gt;&gt;My_Property[i].Type;                                    //Takes users input and stores it in the array 

      cout &lt;&lt; "\t Please enter the property address : ";           //Prompts the user to enter the property address
      cin &gt;&gt; My_Property[i].Address;                               //Takes users input and stores it in the array 
   }

   for (int j = 0;j&lt;2;j++)                                      // for loop counts the property information for all properties entered
   {
      cout &lt;&lt; "\n Information on property number " &lt;&lt; j + 1 &lt;&lt; " is :\n";  //Prints out the stored property ID
      cout &lt;&lt; "\t Asking Price :" &lt;&lt; My_Property[j].Asking_Price&lt;&lt;endl;  //Prints out the stored asking price for the property 
      cout &lt;&lt; "\t Property Type : " &lt;&lt; My_Property[j].Type&lt;&lt;endl;            //Prints out the stored property type 
      cout &lt;&lt; "\t Address : " &lt;&lt; My_Property[j].Address&lt;&lt;endl;           //Prints out the stored address for the property

   }

   for (int k=0;k&lt;2;k++)    
   {
      cout &lt;&lt; "\n Please enter the property ID for the property you would like to delete : \n ";
      cin&gt;&gt; My_Property[k].ID[3]; 

      if(My_Property[k].ID[3]&gt;2)
      {
         cout&lt;&lt;"\n\n This property ID does not exist, press ENTER to try again: \n";
      }
      else
      {
         //trying to figure out the delete code

      }
      _getch(); //read characters from screen`enter code here`

   }
}
</code></pre>