0 like 0 dislike
34 views
in Computer Science by (1.0m points)
What is function body?

1 Answer

0 like 0 dislike
by (1.0m points)
A function body is a compound statement containing the statements that specify what the function does.

Syntax

function-definition:

    declaration-specifiersopt attribute-seqopt declarator declaration-listopt compound-statement

/* attribute-seq is Microsoft Specific */

compound-statement: /* The function body */

    { declaration-listopt statement-listopt }

Variables declared in a function body, known as local variables, have auto storage class unless otherwise specified. When the function is called, storage is created for the local variables and local initializations are performed. Execution control passes to the first statement in compound-statement and continues until a return statement is executed or the end of the function body is encountered. Control then returns to the point at which the function was called.

A return statement containing an expression must be executed if the function is to return a value. The return value of a function is undefined if no return statement is executed or if the return statement does not include an expression.

Related questions

0 like 0 dislike
1 answer 75 views
asked Jan 29, 2019 in Science by danish (1.0m points)
0 like 0 dislike
1 answer 102 views
asked Apr 5, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 157 views
asked Apr 4, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 62 views
0 like 0 dislike
1 answer 66 views
0 like 0 dislike
1 answer 65 views
asked Feb 14, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 68 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 43 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 55 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 61 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

7.0k users

Free Hit Counters
...