Quote Originally Posted by JohnW@Wessex View Post
To illustrate Paul's point, consider this bit of code.

Code:
#include <iostream>

using namespace std;

class C
{
public:
    void F1()
    {
        cout << "F1\n";
    }

    void F2()
    {
        cout << "F2\n";
        i = 0;
    }

private:

    int i;
};

int main()
{
    C *p_c = 0;

    p_c->F1(); // Works!
    p_c->F2(); // Crash!
}
'p_c' does not point to a valid object, but as F1 does not access any member variables, it appears to function correctly.
F2, on the other hand, tries to access 'i' and fails.

(Compiled and run under Visual Studio 2008)
Just to add, while "p_c -> F1()" 'works', it is still undefined behavior and may not work in the future.

Viggy