title: This program takes user input and is supposed to sort it using bubbleSort but its outputting letters and numbers and I'm not sure why
body: <p>The output I'm getting when I run this code after inputting any set of integers, and ending the loop with the sentinel number 999, is always 0x7ffd85bc43b0 and I can't figure out why. I think I'm missing some important code somewhere, but I'm not sure where? This program is also eventually supposed to be able to find the mean and median of the inputted numbers as well.</p>
  <pre><code>// HouseholdSize.cpp - This program uses a bubble sort to arrange up to 300 household sizes in
  // descending order and then prints the mean and median household size. 
  // Input:  Interactive.
  // Output:  Mean and median household size. 
  
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;algorithm&gt;
  #include &lt;cmath&gt;
  #include &lt;any&gt;
  #include &lt;stdio.h&gt;
  using namespace std;
  void swapping(int &amp;a, int &amp;b) {      //swap the content of a and b
     int temp;
     temp = a;
     a = b;
     b = temp;
  }
  void display(int householdSizes, int size) {
     for(int i = 0; i&lt;size; i++){
  
     }
  }
  void bubbleSort(int householdSizes[], int size) {
     for(int i = 0; i&lt;size; i++) {
        int swaps = 0;         //flag to detect any swap is there or not
        for(int j = 0; j&lt;size-i-1; j++) {
           if(householdSizes[j] &gt; householdSizes[j+1]) {       //when the current item is bigger than next
              swapping(householdSizes[j], householdSizes[j+1]);
              swaps = true;    //set swap flag
           }
        }
        if(swaps== false)
           break;       // No swap in this pass, so array is sorted
     }
  }
  int main() 
  {
     // Declare variables.
          
     const int SIZE = 300;    // Number of household sizes
     int householdSizes[SIZE];    // Array used to store 300 household sizes
     int x; 
     int limit = SIZE;
     int householdSize = 0;
     int pairsToCompare;
     bool switchOccurred; 
     int temp;
     double sum = 0;
     double mean = 0;
     double median = 0;
  
     // Input household size      
     cout &lt;&lt; &quot;Enter household size or 999 to quit: &quot;;
     cin &gt;&gt; householdSize;
     
     // This is the work done in the fillArray() function
     x = 0;
     while(x &lt; limit &amp;&amp; householdSize != 999)   
     {
        // Place value in array.
        householdSizes[x] = householdSize;
        // Calculate total of household sizes
        
        x++;    // Get ready for next input item.
        cout &lt;&lt; &quot;Enter household size or 999 to quit: &quot;;
        cin &gt;&gt; householdSize;
     }  // End of input loop.
          
     
     // Find the mean
     
     // This is the work done in the sortArray() function
     int n = sizeof(householdSizes)/sizeof(householdSizes[0]);
     bubbleSort(householdSizes, n);
     cout &lt;&lt;householdSizes;
     
     // This is the work done in the displayArray() function
  
     // Print the mean
  
     // Find the median
     
     // Print the median
              
     return 0;
  } // End of main function
  
  
  
  
  
  </code></pre>