So I know that turbo C++ is an old compiler, but that is what our instructor told us to use. I keep getting Constant Expression Required, but on the other compiler it works just as fine.
`
#include <stdio.h>
int main() {
int numberV;
printf("How many numbers: ");
scanf("%d",&numberV);
int numbers[numberV]={};
for (int i=1;i<=numberV;i++){
printf("Enter value [%d]: ",i);
int n;
scanf("%d",&n);
numbers[i] = n;
}
for (i=1; i<=numberV; i++)
printf("%d,",numbers[i]);
return 0;
}
This is the code it works fine. I can store arrays, I can print it out fine and it loops perfectly.
but when I transfer this to Turbo C++, it shows CONSTANT EXPRESSION REQUIRED and Expression Required on this part:
int numbers[numberV]={};
{} is a null set right? So can I put a zero in there or is there any other way I can translate this into the Turbo C++ compiler?