When is memory allocated for variables? Where is memory allocated for each variable? For each variable, when is the memory deallocated?
void fun(int **i) {
    *i = malloc(sizeof(int)*7);
}
int main() {
    int *i;
    fun(&i);
    free(i);
}