forked from yanshengjia/cpp-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lurenjia
committed
Jan 24, 2016
1 parent
9979ca8
commit 6941b5d
Showing
1 changed file
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 3.5 | ||
|
||
**请说明函数原型和函数定义的差别。** | ||
|
||
答: | ||
|
||
**函数原型**由函数返回类型、函数名和形参列表组成。形参列表必须包括形参类型,但是不必对形参命名。函数原型描述了函数的接口。 | ||
|
||
**函数定义**是指对函数功能的确立,包括指定函数名,函数值类型、形参及其类型以及函数体等,它是一个完整的、独立的函数单位。而函数原型的作用则是把函数的名字,函数类型以及形参的类型、个数和顺序通知编译系统,以便在调用该函数时进行对照检查(例如,函数名是否正确,实参与形参的类型和个数是否一致),它不包括函数体。 | ||
|