2
What will be the output of the program?
#include <iostream>
using namespace std;
class P {
int v;
public:
P(int x) : v(x) {}
friend int peek(const P &p);
};
int peek(const P &p) { return p.v; }
int main() { cout << peek(P(42)) << endl; return 0; }Medium