analyze each program and figure out what is wrong with the memory management in the code and how to fix the code.
#include #include #include #include const int SIZE = 10;int *myfunction() {int array[SIZE];for (int i = 0; i< size;="" i++)="">array[i] = 0;}return array;}intmain(int argc, char *argv[]){int *p = myfunction();for (int i=0; iprintf("%d: %d\n", i, p[i]);}return 0;}
const int SIZE = 10;
int *myfunction() {int array[SIZE];for (int i = 0; i< size;="" i++)="">array[i] = 0;}return array;}
intmain(int argc, char *argv[]){int *p = myfunction();for (int i=0; iprintf("%d: %d\n", i, p[i]);}
return 0;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here