Skip to Content
C语言核心技术(原书第2版)
book

C语言核心技术(原书第2版)

by Peter Prinz, Tony Crawford
August 2017
Intermediate to advanced
798 pages
17h 44m
Chinese
China Machine Press
Content preview from C语言核心技术(原书第2版)
174
|
第
11
章
在第
2
章和第
10
章中,介绍了枚举、结构和联合类型声明。本章主要讨论对象、函数和
typedef
的声明。
11.1 对象与函数声明
这些声明包含了一个声明符列表(
declarator list
),内含一个或多个声明符。每个声明
符都用于为一个对象或函数声明一个标识符。这类声明的通用形式为:
[
存储类修饰符
]
类型声明符
[,
声明符
[, ...]];
上述语法每个部分的描述如下:
存储类修饰符
在声明时最多只能使用一个存储类修饰符,它们是
extern
、
static
、
_Thread_
local
、
auto
或
register
,或者是
_Thread_local
与
extern
或
static
之一
的结合。这
些存储类修饰符的准确含义,以及它们使用的限制,在
11.1.2
节中介绍。
类型
可以使用多个类型修饰符,也可能包含类型限定符。类型修饰符有以下几种:
•
基本类型
•
void
类型
•
枚举、结构或联合类型
•
通过前面
typedef
声明定义的名称
在函数声明中,
type
也可以包括类型修饰符
inline
或
_Noreturn
。
在对象声明中,
type
可以包含一个或多个类型限定符
const
、
volatile
和
restri-
ct
。
在
C11
的实现版本中支持原子对象,可以使用类型限定符
_Atomic
,或使用形式
为
_Atomic(
类型名称
)
的类型限定符,来声明一个原子对象。在
11.1.3
节介绍了各种
类型限定符及其应用示例。
C11
关键字
_Aligans
允许修改所声明对象的对齐方式。关于对象对齐方式的更多细
节,请参见
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法精讲视频课程:24篇系列讲座

算法精讲视频课程:24篇系列讲座

罗伯特·塞奇威克, 凯文·韦恩(Kevin Wayne)

Publisher Resources

ISBN: 9787111562207