1 / 8

Recitation September 12 , 2014

Recitation September 12 , 2014. Attendance word: whisk Particularly if you weren’t at discussion last week! New webpage: http:// enee150section0101.weebly.com / Office hours: 12:30-1:30 , Mondays and Wednesdays By appointment. Announcements. Homework 1 Due: Monday, September 15 th

oksana
Download Presentation

Recitation September 12 , 2014

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Recitation September 12, 2014

  2. Attendance word: whisk • Particularly if you weren’t at discussion last week! • New webpage: • http://enee150section0101.weebly.com/ • Office hours: • 12:30-1:30, Mondays and Wednesdays • By appointment Announcements

  3. Homework 1 Due: Monday, September 15th • Email me early!! • Submit it as a zip file with a separate file for each problem: • Sample command: zip hw1.zip problem1.c problem2.c problem3.c Homework 1

  4. Improves clarity and readability • Group functions with a similar purpose together (believe me, it makes them easier to find!) • To compile: • gccmain.csupporting.cdefinitions.h Separate Files

  5. Pre-declaration of a function: • Takes place in a header file or above “main” • Ex. intfunction_name(int,int); • Calling the function inside of another function: • Omit the variable types and insert the variable to be passed in. • Ex. a=function_name(b,c); • Writing a function: • Can be written in a separate file or underneath main. • Include return and input variable types and names. • Ex. intfunction_name(int first, int second) { //Function code return 0; } Functional Decomposition

  6. Tips for creating functions: • Break the problem into the tasks that need to be completed. • Use hierarchical decomposition • Check each function as you go. Functional Decomposition

  7. fprintf • fprintf(outfile, “Output=%d”, output); • fscanf • fscanf(infile, “%c”, in_character); • getc(FILE *) • putc(char, FILE *) • Similar to printf, scanf, getchar, and putchar • EOF I/O Function

  8. Homework work time!

More Related