As pointer stores memory address, so the size of the pointer is the size of memory address. If the executable is compiled for a machine with architecture of 32-bits, the memory address will be of 32-bits and so pointer size will be 32-bits (4 bytes).

This is same irrespective of data type pointer is pointing to. For example,

#include <iostream>
 
int main(int argc, char const *argv[])
{
    int* iptr{};
    char* cptr{};
    double* dptr{};
 
    std::cout << "int pointer size " << sizeof(iptr) << "\n";
    std::cout << "char pointer size " << sizeof(cptr) << "\n";
    std::cout << "double pointer size " << sizeof(dptr) << "\n";
    return 0;
}

Running this on my 64-bit machine, it gives following output:

int pointer size 8
char pointer size 8
double pointer size 8

So, pointer size is 8bytes (64bits) for all the types.

References

  1. https://www.learncpp.com/cpp-tutorial/introduction-to-pointers/