ENGR 101 Lecture Notes - Lecture 15: C Standard Library, Data Element

99 views3 pages
31 Mar 2015
School
Department
Course

Document Summary

Engr 101: introduction to computers and algorithms - lecture 15: functions in c++ and. Repetition leads to errors because there are more room for typos. Makes debugging more difficult because mistakes are repeated. Future users find repetitive code harder to read and understand. Functions encapsulate algorithms so they can be written once and used repeatedly. Pass by value copies the data from the caller to a new location in the algorithm. When pass by value is used to send data back to the caller, this is called a return. The caller has the option to ignore this kind of returned data. Pass by reference gives direct access to the data in the caller"s environment. The caller cannot ignore pass by reference data sent to it since the data was directly changed. Side effects: any change to a data element that exists outside the called function. Functions can either be pre-defined library functions or user-defined functions.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents