Why difference between two pointers is not equals to size of type?
问题 I have the simple program: #include <iostream> using namespace std; int main() { int a = 5; int b = 6; int* p1 = &a; int* p2 = &b; std::cout << p1 << " " << p2 << " ,sizeof(int)=" << sizeof(int) << std::endl; system("pause"); return 0; } It produces the following output: 00DBF9B8 00DBF9AC ,sizeof(int)=4 but, 00DBF9B8 - 00DBF9AC == С . I cannot understand this result. If I modify the program like this: #include <iostream> using namespace std; int main() { static int a = 5; static int b = 6;