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
f(10,“Hello”);
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):
Continue reading ‘Pointer To C++ Class Methods; Or Should You Call ‘em “Method Pointers”?’

pondering “does it really work that way?” Even at times I find myself doing things, rather subconsciously, I believe would bring me better luck just because it produced better results in the past. This would even include something as unrelated and silly as using “one particular type of” pen for my univ exams. Every time I thought it was mere stupid I would very soon find convincing myself “there’s nothing wrong in using this particular pen; and just in case it brings luck, you never know.” At other times, these things don’t really seem all that unrelated as they apparently do. For example, using “a particular type of” pen actually would make me more comfortable while writing and hence wouldn’t infuriate me during a lengthy exam; and my result vastly depended on the variation of my mood along the length of the exam.
1992, a guy from University of Edinburg was given the task to design a CASE (Computer Aided Software Engineering) tool to be run in both Windows and Linux system. At that point in time only a few cross platform GUI APIs were available and were very expensive for an university to spend on an in-house experimental tool. But that didn’t stop