This one is after a real long break from blogs :).
Function pointer is pretty commonplace among C/C++ developers unlike “pointer to C++ class methods.” For those who have never used it or even heard of it; it really is very similar to “Function Pointer” from outside, though its internal mechanism is entirely different and its syntax is quite ugly. So, without much literature, let’s see how one would make a pointer to a C++ method. Before that, let’s review the usual function pointer of C a little bit:
// define a function type FUNCTION that takes int and char* as argument
typedef int (*FUNCTION) (int, char*);
// Declare a funciton pointer f of type FUNCTION
// and make f point to some function that takes int and char* as argument.
FUNCTION f = some_function;
// Simply call the function with an int and char* argument
So that’s how function pointers are dealt in C. Following is a snippet that shows how to declare a function pointer that points to a method of a C++ class and then finally shows how to call that method via the function pointer (or “method pointer,” if you like to call it that way):
Have you ever encountered one such dreaded warning messages ( warning C4251 ):
D:\Microsoft Visual Studio .NET 2003\Vc7\include\list(93) : warning C4251: ‘std::_List_nod<_Ty,_Alloc>::_Alnod’ : class ‘std::allocator<_Ty>’ needs to have dll-interface to be used by clients of class ‘std::_List_nod<_Ty,_Alloc>’
And did you ever wonder what caused it or perhaps how to solve this warning problem. Honestly, I still could not figure out the right workaround with STL containers but found this Microsoft Link useful.
Yes, read this if you are kind of bored or probably want to be too fussy about “How things work?” Have you ever wondered how compilers know how many instances of a class had been previously allocated when delete  is called; because delete  might have to traverse through each of the object and call their destructor. So it must be running some kind of loop right? But where does the compiler get the number of instances?
Simple answer to this, perhaps, million dollar question is “Experience.” Now that’s vague enough to be applied to every other language on the planet. So what really does make someone a good C/C++ coder. Btw, do not even dare asking this question to Bjarne Stroustrup or Dennis Ritchie or perhaps guys like Linus Torvald 🙂 since they surely have their own definition of being “good” which comprise only themselves :).
Following is an excerpt of an email that I wrote to someone suggesting him which areas to explore to attend an interview for the game dev team at ReliSource Ltd: