Shared pointer is working without assign memory to Win class.
Code:
class Win
{
public:
void disp()
{
//Do something
}
};
int main()
{
std::shared_ptr<Win> sharedptr;///holds null pointer
sharedptr->disp();//// why its working
}
Why it's calling above function without assign memory to it. Could someone help me out of this?