•Find the logic
error:
•#include
<iostream>
•using namespace std;
•void foo( int* x );
•
•int main()
•{
• int* x = NULL;
• foo(x);
• cout << (*x) << endl;
•}
•void foo( int* x )
•{
• int y = 6;
• x = &y; // Returning the address of a local
variable
•}
•