C++のsizeof(ポインタ)とsizeof(リファレンス)の違い

リファレンスとポインタの
sizeofの違い


```cpp
#include<iostream>
using namespace std;
int main()
{
	char b = 30;
	char *p = &b;
	char &ra = b;
	cout<<sizeof(p)<<endl;
	cout<<sizeof(ra)<<endl;
	system("pause");
	return 0;
}
结果:
4
1
请按任意键继续。。。

ポインタはポインタ型のサイズを表し、
参照は定義された変数の型を表します。

おすすめ

転載: blog.csdn.net/psq1508690245/article/details/116105588