As far as I know about data types in C/C++, while declaring a variable, we need to declare its data type, which tells the compiler to reserve the number of bytes in the memo
The problem is not about pointer size but pointer dereferencing. (wether in C or C++)
Say you have:
int* someint; float* somefloat;
*someint references a memory size of sizeof(int), whereas *somefloat references a memory size of sizeof(float) which are different.
*someint
sizeof(int)
*somefloat
sizeof(float)