Transcript of "Prsentation on functions"

1.
GROUP MEMBERS

2.
The program may become too large and complex and as a result the task of debugging, testing and maintaining becomes difficult. if a program is divided into functional parts , then each part may be independently coded and later combined into single unit .These sub programs are known as functions

3.
<ul><li>Functions are the user defined data types. </li></ul><ul><li>Functions are having modular approach. </li></ul><ul><li>It facilitates top - down modular programming. </li></ul><ul><li>A function may be used by many other programs. </li></ul><ul><li>It is easy to locate and isolate faulty function for further investigations. </li></ul>

8.
<ul><li>A function must follow the same rules of information as other variables names . </li></ul><ul><li>Additional care must be taken to avoid duplicating library routine names or operating system commands . </li></ul>

9.
<ul><li>The arguments may be void. </li></ul><ul><li>The argument list contains valid variable names separated by commas. </li></ul><ul><li>The list must be surrounded by parenthesis . </li></ul><ul><li>No semicolon follows the parenthesis. </li></ul><ul><li>The argument receive value form the calling function ,thus providing a means for data communication from the calling function to the called function. </li></ul><ul><li>All the arguments should be declare with its data type. </li></ul>

19.
<ul><li>We are in main Function </li></ul><ul><li>The addition is 30 </li></ul>

20.
<ul><li>The main objective of passing arguments to function is message passing. The message passing is also known as communication between two functions i.e., between caller and callee functions. There are three methods which can pass values to the function:- </li></ul><ul><li>Call by value (Pass by value) </li></ul><ul><li>Call by address (Pass by address) </li></ul><ul><li>Call by reference (pass by reference) </li></ul>

21.
<ul><li>The value of the actual argument is passed to the formal arguments and operation is done on the formal arguments. </li></ul><ul><li>Any change in the formal arguments does not effect the actual arguments because formal arguments are photo copy of the actual arguments. </li></ul><ul><li>When the function is called it does not affect the actual arguments. </li></ul><ul><li>Changes are made in the f0rmal arguments are local to the block of called function </li></ul>

24.
<ul><li>Instead of passing values address is passed. </li></ul><ul><li>Function operates on address rather than values. </li></ul><ul><li>Formal arguments are pointers to the actual arguments. </li></ul><ul><li>Changes made in the argument are permanent. </li></ul>

27.
<ul><li>When a function is declared as inline ,the compiler copies the code of the function in the calling function. </li></ul><ul><li>Function body is inserted in place of function call during compilation. </li></ul><ul><li>Passing of control between caller and callee function is avoided. </li></ul>

28.
<ul><li>The inline function is mostly used when calling of function is small. it is advisable to use the inline function for small programs. </li></ul><ul><li>Inline mechanism increases execution performance in terms of speed.the program using inline function needs more memory space since the inline functions are copied at every point </li></ul>

31.
<ul><li>If the functions is recursive. </li></ul><ul><li>Function contain a static variables. </li></ul><ul><li>Function contain control structures. </li></ul><ul><li>Main function can not work as inline. </li></ul>