By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Because the elements of an array are stored in consecutive memory addresses on the computer and the name of the array is equivalent to the address of the first element in it, it's easy to use pointers instead of subscripts to read and write the values of an array.

Look at the following program. It compiles correctly under every standard-conforming compiler. At first, this may seem surprising because seemingly, because it's impossible delete an object which is ...

I am trying to write a template that somewhat resembles how an inner class works in Java:
template
class Callback
{
public:
Callback(T& t) : parent(t) { }
void Execute() { parent.*F(); }
private:
T& parent;
};
In Visual C++ 6, this complains that F is an invalid template argument, but when I remove the T and hardcode a class in as:
class Parent;
template
class Callback { /* ... */ };
... it works fine. Is this just a problem with VC6 or am I doing something wrong or ambiguous?

C++ allows casting a pointer to member functions of one type to another pointer to member, as long as the signatures of the two match. However, the results of such a cast are implementation-defined. ...

I am collecting a number of function pointers in C++ and before I call them I want to check to see if they have been set. I really want to avoid calling them if they aren't valid. I have tried
the following "if func != Null { ... " but I get an error.