G-17

存储类 变量的类型决定了项目的全局生存期还是局部生存期。在C中, 类型定义 与其他存储类(auto、register、static和extern)一样,被视为一个存储类 类型定义 是为现有类型指定替代名称。

null

例如,下面的程序编译并运行fime

#include <stdio.h>
int main()
{
typedef int points;
points x = 5;
printf ( "%d " , x);
return 0;
}


输出:

5

但以下程序因编译器错误而失败。

#include <stdio.h>
int main()
{
typedef static int points;
points x;
return 0;
}


输出:

Compiler Error: multiple storage classes in declaration specifiers

看到这个了吗 测验 有关存储类和类型说明符的练习。如果您发现任何不正确的地方,或者您想分享有关上述主题的更多信息,请写下评论。

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享