title: bubble sort a 3d array in c++
body: <p>i want to use a bubble sort to a external data file while looks like this.</p>
  
  <p>00000002</p>
  
  <p>45</p>
  
  <p>56</p>
  
  <p>32</p>
  
  <p>46</p>
  
  <p>00000001</p>
  
  <p>87</p>
  
  <p>95</p>
  
  <p>83</p>
  
  <p>100</p>
  
  <p>so all the data that is under 00000001 appear before 00000002. i'm guessing in order to do so, i need to use a 3d array. is there is a way a way to store all the data under 00000001 under a variable and just use a simple bubble sort method to sort it. if this can be done, then i could use something like this to sort.</p>
  
  <pre><code>void displayArray(int sArray[2])
  {
      int i = 0;
      while(i&lt;2)
      {         
          cout &lt;&lt; sArray[i];
          cout &lt;&lt; "\n";
          i++;
      }    
  }
  
  void sortArray(int sArray[2])
  {
      int temp = 0;
      bool sorted = false;
  
      while(sorted == false)
      {
          sorted = true;
          for(int i=0; i&lt;1;i++)
          {
              if(sArray[i]&gt;sArray[i+1])
              {
                  temp = sArray[i];
                  sArray[i] = sArray[i+1];
                  sArray[i+1] = temp;
                  sorted = false;
              }
          }
      }
  }
  </code></pre>