0

I know variable length arrays are not allowed in c++. My code is currently as follows:

int main(){
  int t;
  cin >> t;
  double h[t];
}

How can I create an array with length t then?

Edit: the assignment only allows char, bool, int and double. Vector isn't allowed. When I tried to compile it, it says ISO C++ forbids variable length array 'h'.

throwaway
  • 55
  • 5

0 Answers0