It is certainly possible for an instance to know its name from within the class method:
#include <iostream>
class Foo {
public:
void Print() { std::cout << "Instance name = " << this << std::endl; }
};
int main() {
Foo a, b;
a.Print();
b.Print();
return 0;
}
will produce the output similar to this:
Instance name = 0x7fff502b8b48
Instance name = 0x7fff502b8b40
As for knowing the variable name, it is certainly not possible. The existence of the object does not imply the existence of the variable - this instance:
new Foo();
will exist for the remaining duration of the process, yet will never be associated with any variable. The language concept of variables is not reflected in the contents of said variables, and any potential relation between language variable and an object is expressed only in the generated code and not in generated data or meta-data. Barring of course the access to the debug information which, as already pointed out, is not part of the language.