'class' keyword in variable definition in C++

前端 未结 3 1330
天命终不由人
天命终不由人 2020-12-17 10:59

Before anyone asks, yes, this is part of a homework, and yes, I did a lot of Googling before asking. I spent the last hour searching intensively on Google with many, many di

3条回答
  •  有刺的猬
    2020-12-17 11:05

    An elaborated type specifier is a type name preceded by either the class, struct, enum, or union keyword.

    class identifier 
    struct identifier 
    enum identifier 
    union identifier
    

    An elaborated type specifier is used either for emphasis, or to reveal a type name that is hidden by the declaration of a variable with the same name in the same scope.

    source

提交回复
热议问题