2010-11-25 5 views
1

: 표준 변환이 : 배열 - 투 - 포인터 변환 : $ 4.4 : 자격 변환/5 점표준 변환 : 자격 변환이 ISO의 포인트입니다

A multi-level pointer to member type, or a multi-level mixed pointer and 
    pointer to member type has the form: 
      cv 0 P 0 to cv 1 P 1 to . . . cv n − 1 P n − 1 to cv n T 
    where P i is either a pointer or pointer to member and where T is not a 
    pointer type or pointer to member type. 

하나의 예를 들어 줄 이것도 알라 가능 설명 할 수 .. 그 형태에 실제로 의미가있는 것이 무엇입니까? 마찬가지로 ... 해당 섹션에 다른 형식이 있습니다 (자격 변환)

답변

1

그들은 단순히 포인터 이외의 포인터를 가리키는 포인터에 대한 포인터를 가질 수 있다고 말합니다. 도중의 각 단계에서 const, volatile 또는 둘 다를 가질 수 있습니다. 따라서 예를 들어, 당신은 할 수 : x을 의미

int const * volatile *const volatile x; 

는 const를하는 CONST의 INT에 휘발성 포인터 휘발성 포인터이다.

+1

유 준 예를 내게 말할 수 U type..can 멀티 레벨 poiner하지만 아무것도 없다, 전체 문장은 –

+3

@BE 학생을위한 대표 : 나는 조각을 명확히하기 위해 노력했다 당신은 각 수준에 잠재적으로 별도의 한정자가있는 다중 수준 포인터 만 다루는 게시했습니다. 그것이 정말로 말한 전부입니다. 나는 당신이 무엇을 의미하는지 모르겠다. "완전한 진술은" –

+1

다중 레벨 혼합 포인터와 멤버 유형에 대한 포인터는 다음과 같은 형식을 나타냅니다. –

3

다단계 포인터은 포인터에 대한 포인터입니다.

변수는 일반적으로 const 또는 volatile 일 수 있습니다 (이들은 cv-qualifiers입니다). 포인터가 있으면 포인터가있는 데이터와 포인터 자체에 cv 한정자를 둘 수 있습니다. 다단계 포인터가 있으면 모든 레벨에서 cv 한정자가있을 수 있습니다. 예를 들어

:

int i1 = 1; 
const int i2 = 2; 
int * p1 = &i1; // p1 is a non-constant pointer to a non-constant int 
int * const p2 = &i1; // p2 is a constant pointer to a non-constant int 
int const * p3 = &i2; // p3 is a non-constant pointer to a constant int 
const int * p4 = &i2; // same as p3 
int const * const p5 = &i2; // p5 is a constant pointer to a constant int 
int * * pp1 = &p1; // non-const pointer to non-const pointer to non-const int 
int * * const pp2 = &p1; // const pointer to non-const pointer to non-const int 
int * const * pp3 = &p2; // non-const pointer to const pointer to non-const int 
int const * * pp4 = &p3; // non-const pointer to non-const pointer to const int 
// etc. 
관련 문제