C++:权限放大、平移、缩小

权限放大不被允许,但是权限平移权限缩小是被允许的

权限放大:

	const int c = 20;
	int& d = c;

权限平移:

    //1.
	int a = 10;
	int& b = a;
    //2.
	const int c = 20;
	const int& d = c;

权限缩小:

	int a = 10;

	const int& e = a;

你可能感兴趣的:(C++,c++)