CSC 230 C and Software Tools Rudra Dutta

  • Slides: 9
Download presentation
CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

General Description l l l l Learn procedural programming in C Stages of program

General Description l l l l Learn procedural programming in C Stages of program compilation and execution Memory allocation and de-allocation Gain perspective in programming methodologies Program in “chunks” - recognize successively higher levels of organization Work from the command line with simple tools Overarching gain from course - conceptual

Instructional Objectives l Upon successful completion of this course, a student will be able

Instructional Objectives l Upon successful completion of this course, a student will be able to. . . – – – write small to medium C programs having several separatelycompiled modules. explain what happens to a program during preprocessing, lexical analysis, parsing, code generation, code optimization, linking, and execution, and identify errors that occur during each phase. In particular, they will be able to describe the differences in this process between C and Java. correctly interpret error messages and warnings from the preprocessor, compiler, and linker, and avoid them. find and eliminate runtime errors using a combination of logic, language understanding, trace printout, and gdb or a similar command-line debugger. allocate and deallocate memory in C programs while avoiding memory leaks and dangling pointers. In particular, they will be able to implement dynamic arrays and singly-linked lists using allocated memory.

Instructional Objectives (contd. ) – – – use the C preprocessor to control tracing

Instructional Objectives (contd. ) – – – use the C preprocessor to control tracing of programs, compilation for different systems, and write simple macros. write, debug, and modify programs using library utilities, including, but not limited to assert, the math library, the string library, random number generation, standard I/O, and file I/O. use simple command-line tools to design, document, debug, and maintain their programs. use an automatic packaging tool, such as make or ant, to distribute and maintain software that has multiple compilation units. use a version control tool, such as cvs, to track changes and do parallel development of software. distinguish key elements of the syntax (what’s legal), semantics (what does it do), and pragmatics (how is it used) of a programming language.

Class Participation l Focus of lectures - concepts – l Syntax and lexical correctness

Class Participation l Focus of lectures - concepts – l Syntax and lexical correctness hardly need lectures Concepts can be odd Different ones are difficult to different people – Repetition helps – Talking it out helps – l Some active group exercises may be undertaken as class work

Recurring Themes l Getting closer to the machine l Dealing with memory l (Why

Recurring Themes l Getting closer to the machine l Dealing with memory l (Why C? )

Resources Text l Class lecture and notes you take l – Course website Teaching

Resources Text l Class lecture and notes you take l – Course website Teaching assistants l Instructor l Web repositories, other texts, … l

Some Specific Feedback l Programming experience / background – – – Reqd. / not

Some Specific Feedback l Programming experience / background – – – Reqd. / not reqd. for you Year (sophomore, junior, senior, …) Total programming experience Languages Answer code snippet questions l Availability of programming platform in class l Why C? (Personal View)

Code Snippets l Re-write each of the following code snippets, in each case replacing

Code Snippets l Re-write each of the following code snippets, in each case replacing a for statement by a while statement, or vice-versa, but otherwise completely equivalent. while (a < b) { a = a + 1; } for (counter = n; counter != 0; counter = counter - 1) { result = 2 * result; } while (current_value++ < new_num) { create_entry (current_value + i++); } printf (“%d ¥t %d ¥n”, current_value, i);