In order to prepare an array, I wrote code below.
#include <iostream>
using namespace std;
int main(){
const double a=0.1;
const double b=0.01;
const int num=a/b;
double array[num];
return 0;
}
Then, I got an error:
expression must have a constant value.
I don't know how to avoid this error. I searched on the internet, but I couldn't find the solution.