title: bubble sorting and getchar in c
body: <p>I am working with microsoft visual studio 2012 and trying to make a bubble sort. Here is my code:</p>
  
  <pre><code>#include "stdafx.h"
  #include "String.h"
  #include &lt;iostream&gt;
  #include &lt;string.h&gt;
  using namespace std;
  
  int main()
  {
      int array[100], n, c, d, swap;
      printf("enter numbers of elements\n");
      scanf_s("%d",&amp;n);
      printf("enter %d integers\n", n);
      for (c = 0; c &lt; n; c++){
          scanf_s("%d", array);
      }
      for (c = 0; c &lt; (n - 1); c++)
      {
          for (d = 0; d &lt; n - c - 1; d++)
          {
              if (array[d]&gt;array[d + 1]){
                  swap = array[d];
                  array[d] = array[d + 1];
                  array[d + 1] = swap;
              }
          }
      }
      printf("sorted list in ascending order:\n");
      for (c = 0; c &lt; n; c++){
          printf("%d\n", &amp;array[c]);
      }
      getchar();
      return 0;
  }
  </code></pre>
  
  <p>First of all I can't make console stay for a key entry. <code>getchar()</code> seems like not working but i don't have any error. Plus when I see console for a second, I can say that numbers are listed like "-310892". I don't know why.</p>