Lecture 06 - More Functions and scanf

Lecture 06 - More Functions and scanf - 06 More Functions...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: 06 More Functions and scanf Sept. 28, 2006 Announcements A1 was due at noon today. A2 will appear on the web-page tomorrow. Last chance to inform me about midterm conicts. Review Last time we saw variables (which are memory locations to store our data) They make your program able to deal with data that you dont explicitly know when you are writing the program. Review (cont.) We also saw functions. Functions provide a form of modularity to your program instructions. Review (cont.) Modularity is good because it provides: problem decomposition instead of one big problem you have many small ones reusability you can use the same function over and over information hiding you can hide details inside the module Reading Simple programs that dont do much: Book I: Chapter 1 Compiling: Book I: Chapter 2 printf and comments: Book I: Chapter 3 printf formatting: Book II: Chapter 2 (160164). More Reading Creating Functions: Book III: Chapter 5 Lets Write More Functions Example a function with no input or output. void printline( ) { printf(-\n); } Another one Lets write a function with only input arguments: void print_assigment_header( char * name ) { print_line( ); printf( Wecome to Stefan\s %s\n, name ); printf( I hope you enjoy this program\n ); print_line( ); } Putting it together....
View Full Document

This note was uploaded on 04/17/2011 for the course CIS 1500 taught by Professor Kramer during the Spring '06 term at University of Guelph.

Page1 / 6

Lecture 06 - More Functions and scanf - 06 More Functions...

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

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