Short answer: you cannot do that.
Cheating answer: make fun() static
class me
{
public:
me()
{
cout<<"hi";
}
static void fun()
{
cout<<"\nfun"<<endl;
}
};
void main()
{
b::fun();
getch();
}
Dangerous, cheating answer: don't call the constructor
void main()
{
me* b = 0;
b->fun();
}
This works, in this example, because the me class has no member data and no virtual functions (so no virtual function table as implicit member data). If I ever saw anyone submit code like this, I'd recommend they were sacked.
In an interview, they might have been interested in seeing if you had the understanding required to find this 'solution', and to say "In this case it would work, but I wouldn't do it for real".