L08userfuncs

L08userfuncs - Predefined Functions Revisited q q q q q q...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
what are predefined functions? what is: ? function name argument(s) return value function call function invocation what is the type of arguments and the type of return value and why are they important? what is include directive and how is it related to predefined functions? what are type changing functions and why are they needed? what is type casting? Predefined Functions Revisited
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Programmer-Defined Functions
Background image of page 2
Functions are named portions of code Two types of functions: predefined - provided in libraries for the benefit of all programmers programmer-defined - written by programmer To carry out its task the function accepts arguments To use a function the programmer writes the function name and a list of arguments for the function to use. This is called function call (or function invocation ) every function returns a result in a return value a function call can be used in any place an expression or statement is used if a function is used as an expression - the function evaluates to its return value if a function is used as a statement - the return value is ignored arguments and return value of a function are of specified type Functions
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Function Invocation cout << add1(4+5) << endl; Invocation is part of a larger expression. To process the invocation, the function that contains the insertion statement is suspended and add1() does its job. The insertion statement is then completed using the value supplied by add1() .
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/22/2010 for the course CS 23021 taught by Professor Staff during the Spring '08 term at Kent State.

Page1 / 14

L08userfuncs - Predefined Functions Revisited q q q q q q...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online