Typedef

xiaoxiao2021-03-06  43

"C Primer" 3.12

Below is an issue where almost everyone will answer, and the error is to expand TypeDef as a macro.

Know the Typedef below

Typedef char * cstring;

What is the type of CSTR in the following statement?

EXTERN CONST CSTRING CSTR;

The first answer is almost

Const char * CSTR

That is, a pointer to the Const character. But this is incorrect. CONST modified CSTR type, CSTR is a pointer. So this definition declares that the CSTR is a constit pointer to the character (see section 3.5 about Const pointer type)

CHAR * Const CSTR;

转载请注明原文地址:https://www.9cbs.com/read-54298.html

New Post(0)