Please help for this problem////

Hi
The question asks that The one-dimensional array A of integers is given. Increase by 2 each its non-negative element.
I made this program but compiler says "variably modified 'h' at file scope" .
Please help!

#include <stdio.h>
int n;
int h[n];
int a;

int main(int argc, char *argv[])
{
scanf("%d",&n);
for(a=1;a<13;a++)
{
scanf("%f",&h[a]);
}
for(a=1;a<13;a++)
{
a=a+2;

printf("%d",a); }
system("pause");
getchar();
return 0;

}
Last edited on
n has to be a constant.
but it says array" A of integers" can you please rebuild this code?
Last edited on
Please do not double post. It clutters forum and is considered inappropriate.
Main thread link: http://www.cplusplus.com/forum/beginner/112827/
Topic archived. No new replies allowed.