Question: 1.What is wrong with the following function and why? int *setup(int n){ int a[n]; for(int i=0; i

1.What is wrong with the following function and why?

int *setup(int n){

int a[n];

for(int i=0; i

a[i]=i+1;

return a;

}

2. Given the following main function of a program named mylist, if a user types the command line ./mylist 32 64 for its execution, what will happen?

int main(int argc, char **argv){

int n=atoi(argv[1]);

int m=atoi(argv[2]);

int n=atoi(argv[3]);

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!