title: Error: Expression must have integral or unscoped enum type
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;string&gt;
  #include &lt;algorithm&gt;
  #include &lt;sstream&gt;
  
  using namespace std;
  
  int main(){
  
    float size;
  
    float sumNum = 0;
    float maxNum, minNum;
    float mean;
    float totalDev = 0;
    float devSqr = 0;
    float stdDev;
  
    //Create a user input size
    std::cout &lt;&lt; "How many number would you like to enter? ";
    std::cin &gt;&gt; size;
    float *temp = new float[size];
  
    //Getting input from the user
    for (int x = 1; x &lt;= size; x++){
      cout &lt;&lt; "Enter temperature " &lt;&lt; x &lt;&lt; ": ";
      cin &gt;&gt; temp[x];
    }
  
    //Output of the numbers inserted by the user
    cout &lt;&lt; endl &lt;&lt; "Number --- Temperature" &lt;&lt; endl &lt;&lt; endl;
    for (int x = 1; x &lt;= size; x++){
      cout &lt;&lt; "   " &lt;&lt; x &lt;&lt; "   ---     " &lt;&lt; temp[x] &lt;&lt; endl;
      sumNum = sumNum + temp[x];
    }
  
    //Calculating the Average
    mean = sumNum / size;
    maxNum = minNum = temp[1];
  
    for (int x = 1; x &lt;= size; x++){
      if (maxNum &lt; temp[x]){
        maxNum = temp[x];
      }
      if (minNum &gt; temp[x]){
        minNum = temp[x];
      }
    }
  
    //Calculating Sample Standard Deviation
    for (int x = 1; x &lt;= size; x++){
      totalDev = totalDev + (temp[x] - mean);
      devSqr = devSqr + (pow((temp[x] - mean), 2));
    }
    stdDev = sqrt((devSqr / (size - 1)));
  
    cout &lt;&lt; endl &lt;&lt; "The sum: " &lt;&lt; sumNum &lt;&lt; endl; //the sum of all input
    cout &lt;&lt; "The mean: " &lt;&lt; mean &lt;&lt; endl; //calculate the average 
    cout &lt;&lt; "Maximum number: " &lt;&lt; maxNum &lt;&lt; endl; // print biggest value
    cout &lt;&lt; "Minimum number: " &lt;&lt; minNum &lt;&lt; endl; // print smallest value
    cout &lt;&lt; "The range between the maximum and the minimum: " &lt;&lt; maxNum - minNum &lt;&lt; endl; //the range
    cout &lt;&lt; "Deviation: " &lt;&lt; totalDev &lt;&lt; endl;
    cout &lt;&lt; "The squares of deviation: " &lt;&lt; devSqr &lt;&lt; endl;
    cout &lt;&lt; "The Standard Deviation: " &lt;&lt; setprecision(1) &lt;&lt; fixed &lt;&lt; stdDev &lt;&lt; endl;
  
    system("pause");
  }
  </code></pre>
  
  <p>I want to get the size of the array from the user, but when I'm using (<code>float *temp = new float[size];</code>), I got an error "expression must have integral or unscoped enum type." When I input the number, it working nicely up until to the range number. After that, start from deviation to the standard deviation, the calculation all messed up. </p>
  
  <p>If I use <code>int</code> for the 'size' and keep the 'temp' as <code>float</code>, it gave me different error. </p>
  
  <p>How can I fix this?</p>