S
Simon
Hello everybody,
I've got a problem. I'm trying to allocate an array inside a function with
Parameter int n:
main(){
int i;
....
i = strlen(ch);
array(i);
....
}
int array ( int n ){
int a[n];
....
}
but when i compile:
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'a' : unknown size
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
how can i do now?
Thank u in advance for your afforts.
I've got a problem. I'm trying to allocate an array inside a function with
Parameter int n:
main(){
int i;
....
i = strlen(ch);
array(i);
....
}
int array ( int n ){
int a[n];
....
}
but when i compile:
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'a' : unknown size
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
how can i do now?
Thank u in advance for your afforts.