You ask a question I would like to know the answer too. I believe a* b='\0'; this statement is doing some assignment and construction ? How about try below instead.
a* b; //declare b as a pointer variable with no assignment and then below call f() function
b->f();
Your code works fine because f doesn't modifyaccess any data. When you write a member function, the actual code generated for it is equivalent to a static function that takes an extra argument, the object to operate to.