C
CJ
Functions can accept "argv like" variable definitions, i.e. foo(int
argc, char *argv[]), which was defined/initialized in the C start up
stubs, but we can't declare one for our own use.
Example:
foo(char *args[]) { /* implementation excluded }; // ok
int main(int argc,char *argv[])
{
char *myarr[] = calloc(10,sizeof(char *)); // compiler error;
foo(myarr);
}
This once was allowed, but removed and I don't understand why? If a
function receiving an argv-like pointer is not problematic, why
declaration of these a problem?
cj
argc, char *argv[]), which was defined/initialized in the C start up
stubs, but we can't declare one for our own use.
Example:
foo(char *args[]) { /* implementation excluded }; // ok
int main(int argc,char *argv[])
{
char *myarr[] = calloc(10,sizeof(char *)); // compiler error;
foo(myarr);
}
This once was allowed, but removed and I don't understand why? If a
function receiving an argv-like pointer is not problematic, why
declaration of these a problem?
cj