When I run my code, attempting to return a local variable:
#include<iostream>
using namespace std;
int &fun()
{
int x = 30;
return x;
}
int main()
{
fun() = 10;
cout << fun();
return 0;
}
why does some compiler output 0 and some are 30