{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

function

# function - Programming Introduction to Functions g...

This preview shows pages 1–7. Sign up to view the full content.

Introduction to Functions Programming

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

View Full Document
og Fundamentals I: Introduction to Functions /Slide 2 Introduction to Functions A complex problem is often easier to solve by dividing it into several smaller parts, each of which can be solved by itself. This is called structured programming. These parts are sometimes made into functions in C++. main() then uses these functions to solve the original problem.
og Fundamentals I: Introduction to Functions /Slide 3 Advantages of Functions Functions separate the concept (what is done ) from the implementation (how it is done ). Functions make programs easier to understand. Functions can be called several times in the same program, allowing the code to be reused.

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

View Full Document
og Fundamentals I: Introduction to Functions /Slide 4 C++ Functions C++ allows the use of both internal (user- defined) and external functions. External functions (e.g., abs , ceil , rand , sqrt, etc.) are usually grouped into specialized libraries (e.g., iostream.h , stdlib.h , math.h , etc.)
og Fundamentals I: Introduction to Functions /Slide 5 User-Defined Functions C++ programs usually have the following form: // include statements // function prototypes // main() function // function definitions

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

View Full Document
og Fundamentals I: Introduction to Functions /Slide 6 Function Input and Output
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 16

function - Programming Introduction to Functions g...

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

View Full Document
Ask a homework question - tutors are online