다음을 통해 공유


선언 요약

:
declaration-specifiers attribute-seqopt1 init-declarator-listopt ;
static_assert-declaration

:
storage-class-specifier declaration-specifiersopt
type-specifier declaration-specifiersopt
type-qualifier declaration-specifiersopt
function-specifier declaration-specifiersopt
alignment-specifier declaration-specifiersopt

attribute-seq1:
attribute1 attribute-seqopt1

attribute1, 2: one of
__asm __based __cdecl __clrcall __fastcall __inline __stdcall __thiscall __vectorcall

:
init-declarator
init-declarator-list , init-declarator

:
declarator
declarator = initializer

:
auto
extern
register
static
_Thread_local
typedef
__declspec ( extended-decl-modifier-seq )1

extended-decl-modifier-seq1:
extended-decl-modifieropt
extended-decl-modifier-seq extended-decl-modifier

extended-decl-modifier1:
thread
naked
dllimport
dllexport

:
void
char
short
int
__int81
__int161
__int321
__int641
long
float
double
signed
unsigned
_Bool
_Complex
atomic-type-specifier
struct-or-union-specifier
enum-specifier
typedef-name

:
struct-or-union identifier opt{ struct-declaration-list }
struct-or-union identifier

:
struct
union

:
struct-declaration
struct-declaration-list struct-declaration

:
specifier-qualifier-listoptstruct-declarator-list ;
static_assert-declaration

:
type-specifier specifier-qualifier-listopt
type-qualifier specifier-qualifier-listopt
alignment-specifier specifier-qualifier-listopt

:
struct-declarator
struct-declarator-list , struct-declarator

:
declarator
declaratoropt : constant-expression

:
enum identifier opt{ enumerator-list }
enum identifier {optenumerator-list , }
enum identifier

:
enumerator
enumerator-list , enumerator

:
enumeration-constant
enumeration-constant = constant-expression

:
_Atomic ( type-name )

:
const
restrict
volatile
_Atomic

:
inline
_Noreturn

:
_Alignas ( type-name )
_Alignas ( constant-expression )

:
pointeropt direct-declarator

:
identifier
( declarator )
direct-declarator [ type-qualifier-listopt assignment-expressionopt ]
direct-declarator [ static type-qualifier-listopt assignment-expression ]
direct-declarator [ type-qualifier-list static assignment-expression ]
direct-declarator [ type-qualifier-listopt * ]
direct-declarator ( parameter-type-list )
direct-declarator ( identifier-listopt )3

:
* type-qualifier-listopt
*opttype-qualifier-list pointer

:
type-qualifier
type-qualifier-list type-qualifier

:
parameter-list
parameter-list , ...

:
parameter-declaration
parameter-list , parameter-declaration

:
declaration-specifiers declarator
declaration-specifiers abstract-declaratoropt

identifier-list: /* 이전 스타일 선언자의 경우 */
identifier
identifier-list , identifier

:
specifier-qualifier-list abstract-declaratoropt

:
pointer
pointeropt direct-abstract-declarator

:
( abstract-declarator )
direct-abstract-declarator [ type-qualifier-listopt assignment-expressionopt ]
direct-abstract-declarator [ static type-qualifier-listopt assignment-expression ]
direct-abstract-declarator [ type-qualifier-list static assignment-expression ]
direct-abstract-declarator [ type-qualifier-listopt * ]
direct-abstract-declaratoropt ( parameter-type-listopt )

:
identifier

:
assignment-expression
{ initializer-list }
{ initializer-list , }

:
designationopt initializer
initializer-list , designationopt initializer

:
designator-list =

:
designator
designator-list designator

:
[ constant-expression ]
. identifier

:
_Static_assert ( constant-expression , string-literal ) ;

1 이 문법 요소는 Microsoft에만 적용됩니다.
2 이러한 요소에 대한 자세한 내용은 __asm, __clrcall, __stdcall, __based, __fastcall, __thiscall, __cdecl, __inline, __vectorcall을 참조하세요.
3 이 스타일은 더 이상 사용되지 않습니다.

참고 항목

호출 규칙
구 구조 문법
사용되지 않는 호출 규칙