#include <bits/stdc++.h>
using namespace std;
char *fun()
{
    static char arr[1024];
    return arr;
}
int main()
{
    char *str = "geeksforgeeks";
    strcpy(fun(), str);
    str = fun();
    strcpy(str, "geeksquiz");
    cout << fun();
    return 0;
}
The output is geeksquiz. Could someone help me in understanding how the code works step by step? Thank you.
 
    