Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Topic 6 Funcions
- Slide 2
- Ideas of funcions came out of math
- f(x) = x^2 + x + 7
- function name (parameter list) = Function body
- so if f(4) --> take the parameter 4 and run it throught the function f and you get some outcome.
- Out come is the 'return type'
- This chapter we will learn to use and write functions
- an example f functions we have already used
- #include <cmath>
- cout << pow(4.0,3.0) << endl;
- The code for the function pow() lives in cmath, it takes the parameters with it to the function body, runs it, and returns the outcome which is out put to the console.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement