“函数体”是包含指定函数行为的语句的复合语句。
语法
function-definition:
declaration-specifiers opt attribute-seq opt declarator declaration-list opt compound-statement/* attribute-seq 是 Microsoft 专用的 */
compound-statement: /* 函数体 */
{ declaration-list opt statement-list opt }
在函数体中声明的变量“局部变量”具有 auto 存储类,除非另行指定。 调用函数时,将为局部变量创建存储并执行本地初始化。 执行控制权将传递给 compound-statement 中的第一个语句并继续传递,直到执行了 return 语句或到达函数体的末尾。 控制权随后返回到调用功能的点。
如果该函数返回了值,则必须执行包含表达式的 return 语句。 如果没有执行 return 语句或 return 语句不包含表达式,则函数的返回值是不确定的。