#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a = 1;
int *p1 = &a;
cout << "int " << sizeof(p1) << endl;
float b = 1.23;
float *p2 = &b;
cout << "float " << sizeof(p2) << endl;
double c = 1.3456;
double *p3 = &c;
cout << "double" << sizeof(p3) << endl;
system("pause");
return 0;
}

在WIN32编译器下

c++中 指针占几个字节_#include

在x64编译器下

c++中 指针占几个字节_#include_02

由此得出结论:

指针在Win32下的大小为4字节
x64下的大小为8字节