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版)
122
|
第
7
章
int printf( const char *format, ... );
如同该例所展示的,这个参数类型列表的最后一个逗号后,跟着的是省略号(…)。省
略号代表了可选参数。函数
printf()
调用的第一个参数必须是
char
指针。这个参数后面
可能会跟着其他参数。原型并没有包含可选参数的数量或类型等相关信息。
7.2.2 声明长度可变的数组参数
当声明某个函数,其参数是长度可变数组(
variable-length array
),除了在函数定义的
头部,其他地方都可以使用星号(
*
)来表示数组长度。如果使用非常量的整数表达式
来定义数组长度,编译器会将它视为星号。例如,下面所有的声明都可当作例
7-5
中函数
maximum()
的原型:
double maximum( int nrows, int ncols, double matrix[nrows][ncols] );
double maximum( int nrows, int ncols, double matrix[ ][ncols] );
double maximum( int nrows, int ncols, double matrix[*][*] );
double maximum( int nrows, int ncols, double matrix[ ][*] );
7.3 函数如何被执行
执行函数的命令(也就是函数调用)包含函数名,以及
()
运算符(请参见
5.2.8
节)。例
如,下面的语句调用函数
maximum()
来计算矩阵 ...
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