Advertisement
Sinux1

Notes on Functions 3/29/16

Mar 29th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. Review
  2. Functions have 4 parts
  3. 1. Body
  4. 2. Name
  5. 3. Parameter List
  6. 4. Block of code
  7.  
  8. Define Function
  9. *********************************
  10. *
  11. string test(string x) *
  12. { *
  13. return x + " Hello"; *
  14. } *
  15. *
  16. *********************************
  17.  
  18.  
  19. example of use:
  20. *********************************
  21. string abc; *
  22. *
  23. abc = test("Mike"); *
  24. *
  25. cout << abc << endl; *
  26. *********************************
  27.  
  28. This will out put "Mike Hello" on the screen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement