title: Is there a difference between "const int" and "int" in C++?
body: <p>Is there any difference between:</p>
  
  <pre><code>int size = 10000;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>const int size = 10000;
  </code></pre>
  
  <p>This code deals with arrays where the size variable name would go into the array as array[size].</p>
  
  <p>How I have used this in my code:</p>
  
  <pre><code>int main() {
  int size = 50000; // here is where I had const before
  int * items;
  items = new int [size];
  
  //random array for bubbleSort
  for (int i = 0; i &lt; size; i++) {
      items[i] = rand();
  }
  
  clock_t start, end;
  assert((start = clock()) != -1);
  sort1(items, size); //bubbleSort
  end = clock();
  cout &lt;&lt; "bubbleSort(random): " &lt;&lt; (double)(end - start)/CLOCKS_PER_SEC &lt;&lt; " seconds" &lt;&lt; endl;
  </code></pre>