Q:

Size of pointer ( *variable VS variable)

Based on my understanding On 32-bit machine sizeof pointer is 32 bits ( 4 bytes), while on 64 bit machine it's 8 byte. Regardless of what data type they are pointing to, they have fixed size. My computer is running on 64bit, but when i print the size of including the * i get 4 . Why is that so ? whats the difference between printing the variable and printing the *variable.
   int *name = NULL;
    int *add = NULL;

    cout<< sizeof (*name) << endl; // Prints 4
    cout << sizeof (add); //Prints 8

A:

The * operator dereferences a pointer.  In other words, it gives you what it points to.  
name has type int *, so *name has type int.  That means sizeof(*name) is the same as sizeof(int), which on your system is 4.
Likewise, add has type int *.  That means sizeof(add) is the same as sizeof(int *), which on your system is 8.

