Lecture6 - Outline CS11600 Introduction to Computer...

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

View Full Document Right Arrow Icon
1 CS11600: Introduction to Computer Programming (C++) Lecture 6 Svetlozar Nestorov University of Chicago 1/17/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 2 Outline ± Functions ± Passing arguments ± Return values ± Side effects ± Inline functions ± Recursion 1/17/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 3 Functions ± Group of statements that implement some task. ± Why use functions? •Des ign • Repetition •Modu la r i ty • Debugging 1/17/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 4 Declarations and Definitions ± Function declaration: Type name(Type1 arg1, Type2 arg2); ± Argument names are optional. ± Function definition: Type name(Type1 arg1, Type2 arg2) { statements; } ± A return type void means that the function does not return a value. type of return value name of function type of argument name of argument 1/17/2003
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Lecture6 - Outline CS11600 Introduction to Computer...

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

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